I’m trying to make a very ‘arcade-y’ racer game, and I’m having a couple issues:
I have a very specific idea in my head for how I want the physics to work, and I tried getting it to work with a RigidBody for a couple days, but I couldn’t even get anywhere close, so I gave up on that. But a CharacterController comes with a built in CapsuleCollider that I don’t want. A vertical capsule doesn’t fit the shape of my cars at all.
So… I’m halfway through rolling my own; I’ve got the driving and turning physics pretty much exactly where I want them, but I’m banging my head against Gravity - specifically, detecting collisions with the ground. Without characterController.Move() I’m not sure how to test for collisions, because I don’t get the return values to check for things. And I can’t find a definitive answer for if CharacterController.Move() will use any collider other than it’s built in capsule.
So I’m a bit stuck and not sure what I should do…
- Without a RigidBody, I lose auto-gravity. (and some convenient side-to-side springyness that would handle body-rocking, but that’s simple-ish)
- Without a CharacterController, I can’t use .Move() and more importantly it’s collision return values, but with it, I’m stuck with a collider I can’t use and don’t want.
Am I SOL here? Do I have to just brute force my way though the gravity problem? Or is there some way of contorting CharacterController to do what I want, so I can use Move() instead of “transform.position += blah;” like I am now? Or should I just suck it up and write my own gravity system from scratch.
My current car avatar setup is like this, so people can see sorta where I’m going:
CAR (Rigidbody [for the side-to-side springy sway] / ArcadeRaceCarController [homebrew controller])
--- Body (mesh for the body)
--- Wheel_FL (mesh for the wheel / WheelCollider )
--- Wheel_FR ( Same )
--- Wheel_BL ( Same )
--- Wheel_BR ( Same )
my ArcadeRaceController script currently doesn’t have much other than some vector math in FixedUpdate to determine which way the car goes, and then a ‘transform.position += vector’ to move.