Page 1 of 1

Strange GE frame rate value issue

PostPosted: Sat Mar 30, 2013 8:30 pm
by bamby1983
This works - The result is either 24 or 25 every time.

Code: Select all
temp_3.textNumber=real_fps;



This doesn't work - the result is 0 every time.

Code: Select all
temp_3.textNumber=(1/real_fps);



Does anyone know why this occurs?

Re: Strange GE frame rate value issue

PostPosted: Sat Mar 30, 2013 8:43 pm
by skydereign
That's because you are using integer arithmetic. You have to be using variables with floating points, otherwise it clobbers the floating point.
Code: Select all
temp_3.textNumber = 1.0/real_fps;

Re: Strange GE frame rate value issue

PostPosted: Sat Mar 30, 2013 9:51 pm
by bamby1983
Thanks! I didn't know that about C.