Quantcast
Channel: GameSalad 101 — GameSalad Forums
Viewing all articles
Browse latest Browse all 8931

Accelerometer vs constrain position

$
0
0

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.


Viewing all articles
Browse latest Browse all 8931

Latest Images

Trending Articles



Latest Images