Character sometimes moves beyond Move To limits
ekappleyard@gmail.com
Member, PRO Posts: 6
Hi - I have an actor in my game which is controlled by the left and right keys, jut the x axis. I use the 'Move To' behaviour and i've set the limits of the movement so the character stays on screen. However whilst i'm testing the game the character sometimes goes beyond the limits and goes off screen. Is this an issue with my choice of behaviour? Also will this happen when I eventually come to test it on iPhone? Thanks
Best Answer
-
Socks London, UK.Posts: 12,822
This version you need to hold the keys down for the motion to continue (check out the rule within the otherwise section)
Answers
It's helpful to know that you are using a Move To behavior -- and yes, that particular one can sometimes have unpredictable results -- but you'll need to explain how you "set the limits of the movement."
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
By that I mean I set the x and y coordinates that I want the actor to move to. Basically it just moves left and right controlled by the arrow keys. However sometimes, no telling why, it moves completely past the coordinates i've set
Use constrain position x, try doing the same thing on different ways
Wish you well
Hi ekappleyard@gmail.com try using >= and <= for your limits rather than just =; see if that solves it.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Like @tatiang said, the Move To can be a little temperamental, if you want absolute-no-pass limits you could use the min/max functions, demo file attached - use the left and right arrows to move the actor.
This version has a more inertia when you stop and start. (attached).