3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: '==' not working in script?  (Read 594 times)

« on: February 01, 2012, 01:01:45 PM »
This sounds very strange. I got a project with this script:
OBJ_0 is a sprite.

Code: [Select]
float Timer = 0;
void Main()
{
   if (Timer == 6) iObjectHide(OBJ_0);

   Timer += 0.1;
}

But for some reason OBJ_0 isn't hidden after many minutes!

See this project for an example.


Does anybody have any idea why?
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0

psikoT

« Reply #1 on: February 01, 2012, 01:19:56 PM »
try using >= 6
« Reply #2 on: February 01, 2012, 02:28:53 PM »
try using >= 6

Yeah, it works. But what if I only what to make execute once?
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0

RRSoft

« Reply #3 on: February 01, 2012, 03:19:37 PM »
[]
« Last Edit: February 29, 2012, 11:28:48 AM by RRSoft »
« Reply #4 on: February 02, 2012, 07:35:13 AM »
Yeah, the integers work.

It can be solved quite easily, but is this problem a bug, or am I missing something?
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0

psikoT

« Reply #5 on: February 02, 2012, 08:30:48 AM »
It can be solved quite easily, but is this problem a bug, or am I missing something?

no, that's just a float thingie... if you're increasing 0.1 sixty times per second, maybe you'll never reach the exact integer... or whatever... :P (too lazy to calculate floats now ;D)
Pages: [1]