Jump to content
  • Advertisement
Sign in to follow this  
asterix12

Error Can't implicitly convert bool to float

This topic is 3401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!