Thanks for reading.
How do you change only one component e.g. x direction of the velocity?
I have tried to use setLinearVelocity(vx, nil) to set only x direction. However, this would affect the current y direction motion.
I have also tried to first getLinearVelocity to get vy and then setLinearVelocity(vx, vy). However, this would also affect the current y direction motion.
What I want to do is that: An object is jumping up and down repeatedly, and it would follow the mouse cursor to either jump leftward or rightward. The further the mouse cursor, the higher the x direction velocity.
Thanks. [import]uid: 12769 topic_id: 7865 reply_id: 307865[/import]