Godot Version
Godot 4.3
Question
I am new to Godot and used YouTube tutorials to learn to code but they are all out of date and the move_and_slide() function doesn’t work now. What is the replacement function?
Godot 4.3
I am new to Godot and used YouTube tutorials to learn to code but they are all out of date and the move_and_slide() function doesn’t work now. What is the replacement function?
There is move_and_slide()
and move_and_collide()
. Both are valid but they’re used in different items. Read the inline godot documentation to see what you need to use.
Check out this article. It contains everything you need, including code examples.
I have version 4.3 which means I can not use move_and_slide() or move_and_collide().
As @FencerDevLog pointed out that functions still existing in Godot 4, the only difference is in Godot 4 you don’t pass any arguments to move_and_slide
, the arguments now are properties from CharacterBody2D
.
Where did you get the “move_and_slide() doesn’t exist” info?
This is clearly wrong and as mentioned earlier it still exists, although it doesn’t take any parameters.
If you were having errors, you should read the error and attempt to fix it, otherwise don’t use such an old tutorial if you aren’t at that skill level yet.
When I use move_and_slide() without using any parameters, the error says “not found in base self.” What does that mean?
Your script likely does not extend CharacterBody2/3D. What does the first line of your script say?
Hey, @Gandalf521! If you can include code snippets, screenshots, etc. we can help you more effectively.
The “not found in base self” error like @gertkeno said sounds like you are calling move_and_slide on a node type that doesn’t have the built in function move_and_slide.
Try calling a made up function like this_function_doesnt_exist() and you’ll get the same error.
That will probably fix the problem, Thank you.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.