First off: this is for my first real project in Unity and I’m not a programmer so part of this is being unable to properly read the code - if that is the issue then really I’m looking for a steer (in other words - if it is the code stuff, just tell me and I’ll shaddap). This has been pickling my noodle for a couple of days now.
The issue is:
I have a scene with walls (with box colliders) and a CharacterController. The collision between walls and CC occurs and stops the player from walking through. Sounds great. But the character is occupying a vehicle and the chassis of the vehicle, despite having a box collider, passes through the wall right up to the Camera. So is there a hidden collider on the camera or graphics or firstpersoncontroller that I cannot see? And how do I de-activate it and just enable the box collider of the chassis?
Would it be better to hand-code a simple control script for the movement of the vehicle and skip using the pre-baked CharacterController package (as I don’t really need things like Jumping).
If I’m understanding you - you have a vehicle that can drive through walls.
First, your vehicle should probably have a rigidbody component if it doesn’t. Second, move your vehicle with Rigidbody.Move() in the FixedUpdate() function. Third, make sure your vehicle’s collider is actually encompassing the full vehicle.
Also, while your character is inside the vehicle, you should probably disable the character’s CharacterController and just let the vehicle’s collision do all the work.
Is there a hidden collider built into the CharacterController via the script? That isn’t listed as a component? Because I’m struggling to understand why the Avatar still stops at the wall collider.