Playmaker Forum
PlayMaker Help & Tips => iOS Help => Topic started by: rndmoo on August 08, 2011, 11:27:25 AM
-
Hi,
Is there a clever way of mapping Device.Acceleration to XZ movement like to Character Controller with Axis Input but for Device Acceleration? Or convert Device Acceleration to Axis Input?
/glenn
-
You'd have to check the accelerometer's position at every frame using a low pass filter and compare it to a reference vector. You then can check the direction and/or the angle from the device's orientation to the reference vector. You can use this information to move a character around, etc. For example, you can use the angle difference to determine the character's speed.
I use the accelerometer to move a character around in my current project. It's really easy once you understand how it works. Unfortunately, I only use Playmaker for AI in my game. All else uses custom scripts that are sometimes linked to Playmaker FSMs.