Accelerometer vs constrain position
RocketBrain
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
oh and i'm testing on android in the portrait position.
You won't be able to do it that way. Since you are using moveable just put walls on the edges and use collide behavior.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS