Hey guys (first post!)
I am trying to do something I thought would be pretty simple but I can't figure it out.
Basically.. I have a standard asset vehicle setup with 4 wheel colliders. What I want to do is put two more wheel colliders on the side of the car, rotated 90 degrees on the Z axis, as bumpers to "roll" against guardrails, etc. I tried to do this with a simple script and failed. Nothings seems to rotate the wheelcollider on any axis but Y.
public class BumberAngle : MonoBehaviour {
void Awake () {
// get wheel colliders dropped on it.
var wcs = GetComponents();
foreach(var wc in wcs)
{
wc.transform.SetPositionAndRotation(transform.position, Quaternion.Euler(0, 0, 90));
}
}
If there is no way to do this .. any other ideas?
Thanks in advance.
↧