Cannot implicitly content "bool" to "float"

Please look at this page for posting code on the forums: Using code tags properly

If you alter the method signature so it takes a float as a parameter, you could send the float, instead :slight_smile:

if you really had (want) to keep a bool, you could do this:

private void SetRigidbody(bool j)
{
if(j == false)
   this.GetComponent<Rigidbody>().mass = 0;
else GetComponent<Rigidbody>().mass = 1; // or whatever it is supposed to be.
}
2 Likes