please help me fix some of the code in the GODOT 4 version.

Godot Version 4.3

Replace this line with your Godot version

Question

`please help me fix some of the code in the GODOT 4.3 version.
the code is like this:move_and_slide(transform.basis.xform(Vector3(0, x_pos, moving_vec.z)))
the code does not work and gives such errors:

  1. Identifier “x_pos” not declared in the current scope.
  2. Cannot find property “xform” on base “Basis”.
  3. Function “xform()” not found in base Basis.
  4. Too many arguments for “move_and_slide()” call. Expected at most 0 but received 1.
    Thank you in advance!

First, the main thing is move_and_slide() function does not need a parameter in Godot 4. You just need to set the velocity (built-in variable) of the character body. Another is that functions has changed, read it for more information. And you can watch some Youtube tutorials on how to create player or anything else related to character body.