Hello,
I was wondering if anyone can add a speed modifier to my script. I am trying to make it so my player follows the mouse around, but I don’t want it to be right on the mouse. So, I need a way to modify the player’s speed.
void FixedUpdate ()
{
Vector3 temp = Input.mousePosition;
temp.z = 10f;
this.transform.position = Camera.main.ScreenToWorldPoint(temp);
}
-Many Thanks.
P.S. Tell me why your code works, so I am able to learn.