#How do I set a velocity value to just velocity.x?
4 messages · Page 1 of 1 (latest)
Or do you want to completely convert ALL momentum to horizontal momentum?
In which case, you can create a new vector and set it’s x-value as the length (or the scalar?) of the original vector.
#converts all momentum into strictly horizontal momentum
velocity = Vector2(velocity.distance_to(Vector2.ZERO, 0) if velocity.x > 0 else Vector2(-velocity.distance_to(Vector2.ZERO, 0);
What exactly is happening in game, and what do you want to happen?
yes you can. If you do velocity.x you only affect the x value