I am wanting to use the rigidbody for my Jetpack physics instead of transform.Translate. Here is what I am doing right now:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(MouseControllerBehavior))]
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(CharacterController))]
public class JetpackBehavior : MonoBehaviour
{
public float MaxSpeed = 100;
public float Accel = 1;
public float Thrust = 0;
private void MouseInputRight()
{
Thrust = Mathf.Min(Thrust + Accel, MaxSpeed);
transform.Translate(0, Thrust * Time.deltaTime, 0);
//rigidbody.AddForce(Thrust * Vector3.up);
//rigidbody.AddRelativeForce(Thrust * Vector3.up);
}
private void MouseInputRightUp()
{
Thrust = 0;
}
}
The trouble with doing this is that angular velocity is not calculated and so the player drops straight downward (this looks lame). I have tried adding a rigidbody and then adding force to it, but that does not work. I am using a CharacterController as well and am not sure if that will conflict with the rigidbody.
Any ideas?