WheelColliderSource-ColliderIssue

From Unify Community Wiki
Jump to: navigation, search

I have experienced a couple of issues regarding Colliders and reimplementing the WheelCollider functionality. Specifically are two situations bellow which I have had to work around.

Extending the Collider class

As the Collider class (Collider->Component->Object) doesn't inherit from MonoBehaviour, attempting to add a user defined class extending Collider (BoxCollider or WheelCollider for example) to a game object outputs an error message stating that only MonoBehaviours can be added to game objects, this is despite the original WheelCollider not inheriting from MonoBehaviour. This means that WheelColliderSource cannot be handled like a collider and isn't assigned to the GameObject.collider property.

Instead I am forced to implement WheelColliderSource as a MonoBehaviour as there is currently no other way around the issue.

Rigidbody behaviour without Collider

I came across an odd behaviour from the Rigidbody when applying forces to it if it has no associated Colliders. I have tried playing around with all the Rigidbody settings but none seem to fix the stuttering I experience when there are no colliders under the Rigidbody hierarchy. I will continue to investigate the issue.

For now I have attached a dimensionless SphereCollider to the WheelColliderSource's GameObject to solve the issue.

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox