Open jberryman566 opened 7 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;
When a player nears a boundary, they begin to slow down. This should be a fluent motion to the boundary.