I'm new to C#, and I can't work out why I'm getting the following error on these lines of code.
"error CS0266: Cannot implicitly convert type 'double' to 'float'. An explicit conversion exists (are you missing a cast?)"
float rightEdgeOfFormation = (float) transform.position.x + (width * 0.5); float leftEdgeOfFormation = (float) transform.position.x - (width * 0.5); I thought writing (float) was the cast?
Thanks so much!
float rightEdgeOfFormation = (float) (transform.position.x + (width * 0.5));0.5it's interpreted asdoublevalue, if you want it to befloataddfto the end of number like0.5f.