Is there any diference between
rigidbody.AddForce(Vector3.forward, ForceMode.VelocityChange);
and
rigidbody.velocity += Vector3.forward;
???
I’m making a first person controller with rigidbody and need to use adecuate physics functions to make the character move
They are effectively the same, however overriding velocity can have detrimental effects to realistic physics.
ie, AddForce if it came up against something, would result in AddForce being reduced by the amount of Force the collision is preventing, while velocity would maintain the speed and just plough through whatever out of the way like it was nothing.
It would be like a car hitting a car, as opposed to a train hitting a car.
(train = velocity, car = addforce)
Hopefully this is clear.
yep, tanks.
AddForce all the way
There is one already available here:
http://wiki.unity3d.com/index.php?title=RigidbodyFPSWalker
I use it and its ok. I may attempt to write my own at some point.
oh, nice one, gotta give it a try
wow that was fast, it turned out great, i just added a camera as child to place a high viewpoint and slightly modified the script so you can move while jumping, thank you!