#sqaure is not moving to the right(solved)

13 messages · Page 1 of 1 (latest)

lime helm
#

hi. my sqaure is not moving to the right. i followed the code from titled "Make Your First 2D Game with Godot: Player and Enemy " video. i tried chatgpt but failed. can anyone please help me. TIA

rustic vector
#

Hi Shariar, could I please see a screenshot of your script that is supposed to move your square?

lime helm
#

here if i pass an argument inside move_and_slide function, it shows parser error. so i kept it empty. the code runs but the sqaure doesnt move

polar blade
#

You have no script attached to your scene.

#

Click this button and choose your Player.gd script and see if that works.

lime helm
#

Is this okay? Cause it didn't worked.

rustic vector
#

Is your actor.gd script or your Player.gd script the code that makes the square move right? In your first screenshot it looked like maybe it was your actor.gd script so perhaps attach that script to your Player node instead

lime helm
lime helm
#

Good lord this is gonna make me mad🫠

rustic vector
#

Hi Shariar I have a friendly suggestion. Feel free to ignore it if you would like.
The video tutorial for "Make Your First 2D Game with Godot: Player and Enemy" is taught using Godot 3. I noticed because your Player node extends CharacterBody2D you are using Godot 4. If you are new to Godot I would recommend either following that video tutorial but using Godot 3.5.2 or if you want to use Godot 4 follow the tutorial in the documents instead
https://docs.godotengine.org/en/stable/getting_started/first_2d_game/index.html
This will save you the frustration of trying to translate a Godot 3 tutorial into Godot 4 which if you are just starting out learning is not conducive to the initial learning experience.

lime helm
#

Thanks buddy. I think i might need to use the older one. Yes im using godot 4 and here fhe equivalent to that function is move and collide function. My player is moving now.
Thanks for the suggestion❣️

#

sqaure is not moving to the right(solved)