Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move_and_slide moves all instances of KinematicBody2D #367

Closed
Difio3333 opened this issue Aug 24, 2022 · 2 comments
Closed

move_and_slide moves all instances of KinematicBody2D #367

Difio3333 opened this issue Aug 24, 2022 · 2 comments

Comments

@Difio3333
Copy link

I'm following the Clear Code Pong Tutorial for Godot on Youtube: https://youtu.be/kr1BoEbuveI and I'm trying to convert that code to godot-python.
To move all my instances of RigidBody2D I use the move_and_slide method. When I run the project all velocities that are applied in 3 different scripts are applied to all RigidBody2Ds.
So the Player moves in a random direction as well as up and down and the ball is moving up and down and in a random direction.
The desired outcome would be that the player moves up and down based on my input and the ball moves in a random direction.
I've made a quick 1 min video displaying my issue: https://youtu.be/SAR6KFySayM
Thanks a lot in advance for your help!

@niklas2902
Copy link

I think this issue could be caused be similar to #345 .
Could you replace Vector2.ZERO by Vector2(0,0) and check whether this helps?

@Difio3333
Copy link
Author

Oh my god Niklas! Thanks so much. I was starting to loose my mind and learn GD-Script because of that.
Needless to say that fixed it. Thanks again for taking the time to write your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants