Tuesday, December 5, 2017

unity - When should I use velocity versus addForce when dealing with player objects?


I'm confused about these two methods in the Unity framework. Both make the player object move, stop, change direction, etc. When should one be used over the other and when is one appropriate?



Answer



You'd use velocity to move the object at a constant rate (for example a bullet) and AddForce() to add movement (for example a spaceship thruster). Also note there are two "types" of movement; force and impulse. For a spaceship thruster you'd use impulse.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...