The question is answered, right answer was accepted
Move object without leaving bounds
Hello. Im trying to make a script that moves an object towards mouse position while rotating it, without leaving another object bounds. Something like this:
The blue object moves towards mouse and rotates (the pivot point is inside the little green circle) but doesn't leave the big green circle. I want it to stay as close to the borders as possible, always searching the closest point to the mouse position (I did the drawing too fast :P).
I already managed to make the object rotate correctly and to move towards the mouse position, but can't figure out how to make it move only inside the bounds.
Thanks, and sorry for the bad english :P
Follow this Question
Related Questions
Unexpected Symbol 'end of file' error 1 Answer
Snake like movement in 2D space 0 Answers
How do I assign a velocity to an object on only 1 axis? 1 Answer
Unity 2D Enemy movement problems 2 Answers