Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: karim on February 17, 2014, 08:18:07 AM

Title: iOS device linear movement data, please help!
Post by: karim on February 17, 2014, 08:18:07 AM
Hi guys,

Thanks to the tutorials here, now I know how to get Gyro tilt data and Roll data from device accelerometer. How do we capture the device's linear movement (up,down,left,right) on an X,Y plane??

I'm trying to use this as character controller, instead of WASD, cause tilt doesn't work for my game style, I need user to move the phone linearly.
 
I'm sure it's possible, but I can't figure out how to implement it, I hope someone can help me please.

Thank you!
Title: Re: iOS device linear movement data, please help!
Post by: jeanfabre on February 17, 2014, 11:16:02 AM
Hi,

 you need to get the acceleration values using the "get device acceleration".

 that's your raw data to work with linear movements.

knowing that speed is acceleration*Time, you can set the speed of your object by multiplying the acceleration with the deltatime of that update ( using the action "Get time info" - delta time).


bye,

 Jean

Title: Re: iOS device linear movement data, please help!
Post by: karim on February 18, 2014, 04:38:41 AM
Awesome! Trying it out.

Love you  ;D
Title: Re: iOS device linear movement data, please help!
Post by: karim on February 21, 2014, 06:33:12 AM
Hi jean,

I'm still struggling with this :(

I know I'm making a noob mistake but I'm not sure what it is.

So I didn't record acceleration on Z, which theoretically canceled tilt??
The force is added and all, but the ball only moves when I tilt the phone, not when I move it side to side.

Please find attached what I've done so far, and what I'm hoping to achieve with this.

I really appreciate your help!

Thanks,

Noob Karim
Title: Re: iOS device linear movement data, please help!
Post by: jeanfabre on February 26, 2014, 01:16:25 PM
Hi,

 Give me few more days... thanks. Bump me beginning of next week if I have not replied, cheers.

bye,

 Jean