Contrain actor position based on accelerometer
Hi ![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I'm getting mad lol...
I don't know how to constrain the X position of my actor, based on the X accelerometer...
For exemple, if accelerometer.X =0, my actor position have to be 160, if accelerometer.X=+1 position =300
if accelerometer.X =-1 position=20
Any help on how to make it work?
see this picture to see wht i need (i have to constrain the yellow actor Y position, based on the Accelerometer.X value)
Thank you![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I'm getting mad lol...
I don't know how to constrain the X position of my actor, based on the X accelerometer...
For exemple, if accelerometer.X =0, my actor position have to be 160, if accelerometer.X=+1 position =300
if accelerometer.X =-1 position=20
Any help on how to make it work?
see this picture to see wht i need (i have to constrain the yellow actor Y position, based on the Accelerometer.X value)
Thank you
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
![image](http://i46.tinypic.com/19y3us.png)
Best Answer
-
master200012 Posts: 372
Constrain attribute: self position y to:
160+(accelerometer value * 140)
Make sure you've constrained the position (x) of the actor as well.
Not sure if this is what you're looking for, but I hope this helps.
Answers