Getting speed of tilt on a per axis basis

I am trying to get a value for how fast a user has tiled a device… on a per axis basis.

I have looked at the PhoneAccelerationEvent but dont see how I can use it to do something like…

if the user has tilted on X axis more than 0.5 in less than 0.1 deltaTime then do something cool.

doing it with position is easy, but I just cant get my mind around implementing it on the accelerometer input.

Any ideas?

Is it just the time of day I post these questions… or do I smell bad? :slight_smile:

Anyone have an idea on this?

well i can’t smell you but it is an odd time here. :slight_smile:

not quite sure you’re exact goal but iPhoneInput might work better. something like the docs have here:

file:///Applications/Unity%20iPhone/Documentation/ScriptReference/iPhoneInput-accelerationEvents.html

from Input you can split up acceleration.x .y and manipulate the values with deltaTime etc.

hth…

Hey Pete, already doing that… but it doesn’t give me a rate of change… I need to know how fast the change has happened…

rate of change = change over time
so to get the data you want, you will have to store the old accelerator data and the new one and react basing on the difference.

The accelerator can’t give you “acceleration of acceleration” data :wink:
People tend to forget that all the accelerator actually is measuring is acceleration, it does not measure orientation or speed.

I understand I cant get accel of accel… but I was hoping for a deltaAccel atleast so I didn’t have to store previous and compare as I am dong now.

I actually don’t like that Unity creates any delta data.
They cost time to calculate and many don’t need them …