hey, i did this pretty simple jetpack script:
using UnityEngine;
using System.Collections;
public class Jetpack : MonoBehaviour
{
public float upthrust;
public float forwardthrust;
public Rigidbody rb;
void FixedUpdate()
{
if (Input.GetKey(KeyCode.UpArrow)){
rb.AddForce(transform.forward * forwardthrust);
}
if (Input.GetKey(KeyCode.DownArrow)){
rb.AddForce(transform.forward * -forwardthrust);
}
if (Input.GetKey(KeyCode.RightShift)){
rb.AddForce(transform.up * upthrust);
}
if (Input.GetKey(KeyCode.RightControl)){
rb.AddForce(transform.up * -upthrust);
}
if (Input.GetKey(KeyCode.LeftArrow)){
rb.AddForce(transform.right * -upthrust);
}
if (Input.GetKey(KeyCode.RightArrow)){
rb.AddForce(transform.right * upthrust);
}
}
}
but what i wanna add now (which i don’t know how to do this) is, that the jetpack slowly stops when i dont press any button. cause at the moment is just keeps floating around/accelarates