AndrewRozendal / SkyDiver

Unity Game
2 stars 1 forks source link

Player movement boundaries #3

Open jberryman566 opened 7 years ago

jberryman566 commented 7 years ago

When a player nears a boundary, they begin to slow down. This should be a fluent motion to the boundary.

jberryman566 commented 6 years ago

Possible solution:

Vector3 finalPosition = selected_GameObject.transform.position; finalPosition.x = Mathf.Clamp(finalPosition.x, -finalWidth, finalWidth); finalPosition.y = Mathf.Clamp(finalPosition.y, -finalHeight, finalHeight); selected_GameObject.transform.position = finalPosition;