Sign in to follow this  
asterix12

Error Can't implicitly convert bool to float

Recommended Posts

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this