My goal here is simple. I am making a top down shooter kind of game, and I want the player to simply rotate in one axis, towards where the mouse is on the screen. I got it working, but it rotates so fast that everything is out of control. The following method is called in Update() on my player's game object
void RotatePlayer()
{
var targetPosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 100);
targetPosition = Camera.main.ScreenToWorldPoint(targetPosition);
targetPosition.y = transform.position.y * Time.deltaTime;
transform.LookAt(targetPosition);
}
That rotates in the direction of the mouse, but like I said it rotates so fast that you cannot control it.
As you can see I tried to multiply by delta time, but that did not seem to do anything. Also, changing that last parameter of "100" to a lower number also does not do anything.
Any help is greatly appreciated.