- Home /
Alternatives to CharacterController.Move to drive a car
Hi, I'm using CharacterController.Move to move my character in my 3D game.
I have the problem that I must drive a car (or a shopping cart) and I would need a longer "CapsuleCollider", but unfortunately the CharacterController is stuck with the same shape and always vertical, so if I increase the radius I would need a very big value and there would be ghost collisions on the sides.
What could I use instead of CharacterController.Move to move an object and be stopped by collisions? There are a lot of car driving games made with Unity so there must be a way. I prefer not using Rigidbody if it's not the only solution because Unity's physics is kinda unpredictable! :D
Answer by wewewu · Oct 26, 2020 at 06:13 PM
If you don't want to write your own physics system and keep it simple and cheap, I think Rigidbody is actually the best (or even only) solution (or you can write you own collision and velocity system), using transforms can cause more buggy situations like car stuck in the ground since transforming is far different from moving a thing in real world. I would consider these methods:
Moving Rigidbody (MovePosition()), this is like transforming but base on Rigidbody and less buggy
Changing velocity (or AddForce()), and I think it is better than above.
if you got it right and use the correct setting, if should actually be easy to control the Rigidbody. If you want an amazing driving experience, check out WheelColliders
Your answer
Follow this Question
Related Questions
issue applying vector for slope sliding 0 Answers
[Closed] Physic problems while moving character 1 Answer
How to let a GameObject generate force but not be affected by certain forces? 0 Answers
Bullets colliding with Character Controller 3 Answers
How can I guarantee a CharacterController never leaves the ground? 2 Answers