The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

My current game is a runner platformer where my player is automatically set to move. I've added another object that functions like a lift. But here the problem arrives that whenever I jump on the lift, my player continues moving and does not stop on the lift. I want the player to stop when I'm on the lift. How can I do that?

in Engine by (29 points)

Create an area around the lift and connect the body_entered signal and use that to stop the player from moving.

1 Answer

0 votes

You could make an Area2D node that detects if the player is on the lift. And if the player is on the lift you can set his movment to 0. To do this you would:

  1. Create a Area2D
  2. Create a CollisionShape2D under the Area2D ndoe, so that the Area2D node is the parent.
  3. Now click on the CollisionShape2D node and look at the inspector. Now look under "Shape" and choose a Shape.
  4. Now adjust the shape of the collision to where you want the player to be detected.
  5. Now press the to Area2D then Node then Signals, and choose body entered
  6. You will get a popup window, press the player node.
  7. You will now get the player script infront of you, now under the function that was created you will set the player movment speed to 0.
by (28 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.