Advertisement

Error Can't implicitly convert bool to float

Started by May 29, 2009 10:54 PM
2 comments, last by WitchLord 15 years, 6 months ago
I have a a contact between 2 objets IN_88 (a key with the character) OUT_22 will be the result show on screen. bool key=false; // I declare the key is not taken so it is false (maybe I don't //have to declare it who know? void Main() { if (IN_88=true); OUT_22=1; } I run and get Error Can't implicitly convert bool to float
Working with 3d Rad. Angle Script code.
Maybe:

if (IN_88=true) should be if (IN_88 == true)? (assign vs comparison)

I don't know what language are you working, but that could be a reason. Also, I'm not sure if the ; at the end of "if (IN_88=true);" should be there.

Hope this helps!
Advertisement
I am using 3d Rad and angle script.
ya the == where missing.

ok now I got

bool key=false;
void Main()
{

if (IN_88=true);

OUT_22=1;
}

But I receive

Error!

No conversion from 'bool' to 'float' available.
Working with 3d Rad. Angle Script code.
You really need to question the author of 3DRad as to why he doesn't display the line number for the errors.


bool key=false;void Main(){  if (IN_88=true);  OUT_22=1;}


I've marked a couple of mistakes in your code with red. But even fixing those, I assume IN_88 is a float, in which case you can't compare it with 'true' so you need to change that.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement