touch constraint movement issue
jsorr2
Member Posts: 279
I have an actor constrained to x/y if touch is inside.
I want it to only be able to move in a 500width/500height box that is in the middle of the screen.
My code= "constrain self.X/Y to touch if x>=250, y>=250 x<=750, Y<=750 and touch is inside actor"
BUT as soon as it hits 250 or 750 (edge of box) the actor becomes stuck and can't be moved anymore.
How can I stop it from going outside the box, but still move it?
(I tried searching forums, but no luck)
Answers
Example:
https://www.mediafire.com/?1esi2xl26c83631
@Socks you are amazing, thank you!
Glad it worked for you !