General

sign() question

Started by oran-outan on .

Sign in or create an account to join the conversation.

1 post

Topic starter
hi

if i used : dir = sign(speed) I receive value like :

0. nan 0.
nan nan 0.
...

my code is :

(script on frame) :
decl i;
for (i=0;i<3;i++){
Accel_XYZ = accelerometer;
}

(on expression) : speed = Accel_XYZ-Last_XYZ

speed values are float whose oscillate between +0. / -0.
sign can run with float ?
my interest is detect if I'm on acceleration or deceleration.

thanks for your help
O-O