system
1
I’m working with a RigidyBody attached to a barrel with a sphere collider, and using my movement script which is like this:
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
private Rigidbody rb;
public float movSpeed, rotSpeed, throttle, turn;
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
movSpeed = 25.0f;
rotSpeed = 15.0f;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyUp(KeyCode.UpArrow) || Input.GetKeyUp(KeyCode.DownArrow)) {
//Slower rotation when idle
rotSpeed = 12.0f;
}
//In air shall it slow down rotation speed ???
//Lockrotation
rb.rotation = Quaternion.Euler(0.0f, rb.rotation.eulerAngles.y, rb.rotation.eulerAngles.z);
}
void FixedUpdate()
{
//Moving with keys
throttle = Input.GetAxis("Vertical");
rb.AddTorque(transform.forward * movSpeed * throttle, ForceMode.Acceleration);
//steering
turn = Input.GetAxis("Horizontal") * 1.2f;
rb.AddTorque(Vector3.up * rotSpeed * 1.6f * turn, ForceMode.Force);
}
}
My problem is that, the speed gets limited to a certain amount: 2.5f
What is limiting the speed of my transform ?
Thanks in advance !
Just set Rigidbody.maxAngularVelocity to a greater value. Make sure you read the description carefully 