I modified the prefab standard car controller to become a boat. works really well after tweaking some stuff. one such tweak was adding a script so that when the boat turns it banks slightly into the turn. The bank is determined by the mouse x axis. It works pretty well but sometimes ( I guess i lifted the mouse up or something) it remains a little banked to one side even though I am going straight and I am trying to figure out how to get it back to it’s default rotation of 0. I 've tried storing this value and returning to it upon mouse inactivity bu with pretty inconsistent results
using UnityEngine;
using System.Collections;
public class boatBank : MonoBehaviour {
public float speed = 8f;
void Start () {
}
void Update () {
transform.Rotate(0, 0, -(Input.GetAxis("Mouse X")) * Time.deltaTime * speed );
}
}