Limiting the distance from centre
![mdtajghori](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey guys, I have an actor and I've set it's coordinates to constarin the coordinates of the mouse upon clicking the actor. Now I want to limit the movement of the actor to within a specified radius, say 100 pixels from the centre (0,0). How do I do this?
What I'm trying to make is a 360 degree slingshot with no gravity but the acceleration of the actor depends on the distance of the actor (upon being pulled by the mouse) from the centre (0,0). I've tried following the 'Angry Birds Template' but in vain as my actor doesn't want to move upon being clicked by the mouse. Any detailed help would be much appreciated!
What I'm trying to make is a 360 degree slingshot with no gravity but the acceleration of the actor depends on the distance of the actor (upon being pulled by the mouse) from the centre (0,0). I've tried following the 'Angry Birds Template' but in vain as my actor doesn't want to move upon being clicked by the mouse. Any detailed help would be much appreciated!
Best Answer
-
simo103 Posts: 1,331
@mdtajghori if you open GS and click the +NEW button in the window ... search constrain to circle and when the demo shows double click to open. I believe it will contain the rules you need to set the radius.
and this might help give you some ideas for the shooting part: http://gshelper.com/cat-physics-type-directinal-shooting-in-gamesalad/
Answers