Accelerometer vs constrain position

RocketBrainRocketBrain Member, PRO Posts: 269

So i'm using the accelerometer to control the actor moving left and right across the screen and trying to use constrain position to limit the movement from going offscreen.

Rule: attribute game.accelerometer.x > -0.05
Move 180 relative to scene stacked
game.accelerometer.x * -1500

Constrain Attribute self.position.x = min(400,max(30,self.position.x))

and of course the same but negatives and reversed for the other direction

but the actor slides right off the edge into nothingness. What am i missing? As far as i can figure that should be correct.

Comments

Sign In or Register to comment.