- Home /
How to control an object in a specific area
I am trying to make a ball that can be controlled on the X and Y axis with the arrow keys on a certain plane, but when it touches the adjacent plane, you lose control of the ball. The ball keeps its momentum and continues to roll, however.
I am very new to Unity and C#, with only a small introduction to JavaScript as experience. It would be a great help if someone could teach me how to do this. Thanks in advance!
Answer by Mercbaker · Jul 13, 2017 at 08:46 PM
Use a boolean to determine if the player can control the ball or not.
When the ball collides with the plane, then switch the boolean so that the player can no longer input commands.
The engine physics will take over from that point and the ball will resolve without Player input.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Can't get Object to move Independently 1 Answer
C# Movement Script 3 Answers
Getting Started on Android 1 Answer