I used the script from the hover car tutorial and added it to my bender model with a rigid body everything but the hover aspect of the car works When pressing the keys it moves and rotates but does not float in the air like it should. The script works when i use it on a cube but not the blender model.
`using UnityEngine;
using System.Collections;
public class HoverMotor : MonoBehaviour {
public float speed = 90f;
public float turnSpeed = 5f;
public float hoverForce = 65f;
public float hoverHeight = 3.5f;
private float powerInput;
private float turnInput;
private Rigidbody carRigidbody;
void Awake ()
{
carRigidbody = GetComponent <Rigidbody>();
}
void Update ()
{
powerInput = Input.GetAxis ("Vertical");
turnInput = Input.GetAxis ("Horizontal");
}
void FixedUpdate()
{
Ray ray = new Ray (transform.position, -transform.up);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, hoverHeight))
{
float proportionalHeight = (hoverHeight - hit.distance) / hoverHeight;
Vector3 appliedHoverForce = Vector3.up * proportionalHeight * hoverForce;
carRigidbody.AddForce(appliedHoverForce, ForceMode.Acceleration);
}
carRigidbody.AddRelativeForce(0f, 0f, powerInput * speed);
carRigidbody.AddRelativeTorque(0f, turnInput * turnSpeed, 0f);
}
}