playMaker

Author Topic: iOS device linear movement data, please help!  (Read 3775 times)

karim

  • Playmaker Newbie
  • *
  • Posts: 5
iOS device linear movement data, please help!
« 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!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: iOS device linear movement data, please help!
« Reply #1 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


karim

  • Playmaker Newbie
  • *
  • Posts: 5
Re: iOS device linear movement data, please help!
« Reply #2 on: February 18, 2014, 04:38:41 AM »
Awesome! Trying it out.

Love you  ;D

karim

  • Playmaker Newbie
  • *
  • Posts: 5
Re: iOS device linear movement data, please help!
« Reply #3 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: iOS device linear movement data, please help!
« Reply #4 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