I am having a little trouble figuring out how to make the wheels mesh render er object match up with the Wheelcollider object. I have searched the internet and found a few brief answers for a different version of unity.
Here is my current code:
using UnityEngine; using System.Collections;
public class Position : MonoBehaviour {
public WheelCollider wc;
public Transform tf;
// Use this for initialization
void Start () {
wc = GetComponent<WheelCollider> ();
tf = GetComponent<Transform> ();
}
// Update is called once per frame
void Update () {
transform.position = new Vector3 (tf.transform.position.x + (wc.suspensionDistance * 100), tf.transform.position.y);
I have know idea how to make this work please help!