I'm making a snowboard game were you move left and right and rotate either clock wise or counter. I need to now which accelerometers are what rotation and and how to implement them into my game.
Ok i have used the code ----- constrain attribute: self.rotation to vectorToAngle(devices.accelerometer.y,devices.accelerometer.x*1) -------- it works great accept the snowboarder comes sideways and when he lands on a platform he stays in the same rotation position, I want him to level out with the platform he lands on.
My actor uses the accelerometer to rotate but when he lands on a for example a 30 degree slope and he was rotated 0 degrees before he lands on the slope and he stays in the 0 degree position after he lands on the slope. i need him to stop rotating to the accelerometer when he is on a slope or platform.
this will have to set up before there is a chance of the actor being to close to rotate to the correct angle for the land so I would have a field done with coordinates or invisible actors that jump him out of the accel based behaviour and revert it back to the standard gravity set at about the actor's size above the surface he is to land on.
Ok i changed my mind i want the accelerometer to control the direction the actor moves. there needs to be a neutral position and a left and right position for the actor when you rotate the device.
Comments
constrain self rotation to: vectorToAngle(device.accelerometer.y, device.accelerometer.x*1)
Not sure im getting what you asking. Youu mean u want him to rotate to the same angle parallel with the ground when he lands?