setAccelerometerInterval( frequency) for different object of accelerometer...

how can i set  setAccelerometerInterval( frequency ) for different object of accelerometer…

all object have a accelerometer .

example:

i want my

Box -> AccelerometerInterval(20)

then

ball -> AccelerometerInterval (50)

it is posible?

I am not sure what you want to achieve with this…

The accelerometer interval is a system function:

system.setAccelerometerInterval( frequency )

You then listen for a runtime event listener:

local function onAccelerate( event ) print( event.name, event.xInstant, event.yInstant ) end Runtime:addEventListener("accelerometer", onAccelerate) 

You could of course set the interval to a a specific frequency and then use the values at different points in time.

Hi @jentso,

You can’t set the interval differently for specific objects, but if you’re moving them via some physical force (depending on the accelerometer response), you may be able to set the “gravityScale” differently for certain objects. Or, just apply a factored-down (or factored-up) value to various objects.

Hope this helps,

Brent

I am not sure what you want to achieve with this…

The accelerometer interval is a system function:

system.setAccelerometerInterval( frequency )

You then listen for a runtime event listener:

local function onAccelerate( event ) print( event.name, event.xInstant, event.yInstant ) end Runtime:addEventListener("accelerometer", onAccelerate) 

You could of course set the interval to a a specific frequency and then use the values at different points in time.

Hi @jentso,

You can’t set the interval differently for specific objects, but if you’re moving them via some physical force (depending on the accelerometer response), you may be able to set the “gravityScale” differently for certain objects. Or, just apply a factored-down (or factored-up) value to various objects.

Hope this helps,

Brent