- Home /
how should i move a vehicle correctly in unity,what kind of rigidbody physics should i add to move a vehicle ??
hello I'm new to unity and i stuck for hours searching for a method to move a vehicle but every method has cons because when I use addforce method it does an annoying drifting effect . i tried to rid of it with drag but it is impossible to control especially with changing speed (it make the object ignore gravity). i tried change velocity and rigidbody.movePosition() but they override gravity and of course the translate method doesn't detect colliders . so is there any way to have this vehicle move respecting gravity with no drifting affect ?? thank you
Answer by yonatanab1 · Feb 28 at 09:17 AM
without rigidbodys.
unless your vehicle is a cube, i don't think rigidbodys match here at all.
the best way to do this (in my opinion) would to use a character controller and overall controller.move() or controller.translate();
also writing the gravity of the vehicle yourself would work. (per frame: transform.position -= gravity * time.deltaTime;)
just one little question, can i add rigidbody with character controller ? so the object can be rotated and facing the right angle when climbing an uneven ground .
you can also do that without rigidbodys.
to your question: yes. just not recommended. but if its better than go for it.