I am trying to make my own gun script and for some reason my gun is acting super bumpy. My script is:
public Transform gunHolder;
public float holdSide = 0.3f;
public float holdHeight = -0.2f;
public float moveSpeed = 1;
public float rotateSpeed = 1;
void Start ()
{
}
void Update ()
{
gunHolder.localPosition = new Vector3(holdSide, holdHeight, 0);
transform.position = Vector3.Lerp(transform.position, gunHolder.position, moveSpeed);
transform.rotation = Quaternion.Lerp(transform.rotation, gunHolder.rotation, moveSpeed);
}
Does anyone know a better way of doing this? Thanks.
↧