r/UnityHelp • • Oct 13 '26

Red squiggles not showing. How to fix

Post image

I don’t have a f next to the 0.5 yet it’s not underlining it telling me it’s wrong. I don’t know hot to fix this. I’m using visual studio.

4 Upvotes

8 comments sorted by

1

u/PirateJohn75 Oct 13 '26

It's not an error.  C# will be able to implicitly convert the double to a float.

3

u/Library_Far Oct 13 '26

Ok. I was fallowing a unity learn tutorial and it said I would get a error… I’m in over my head 🙃

2

u/PirateJohn75 Oct 13 '26

Nah, you're doing fine.  It might be an older tutorial.

2

u/cone5000 Oct 13 '26

That’s finally changed??

1

u/Demi180 Oct 14 '26

False. No implicit conversion from double to float. They need to fix their Visual Studio.

2

u/Imaginary-Cod-3746 Oct 14 '26

Sometimes, simply restarting Visual Studio fixes this.

If you hover over the Rotate() method, it should tell you the types of parameters it expects.

Some methods can accept different parameter types. Rotate() could accept both float (decimal numbers that end with an 'f') or double (decimal numbers that end with a 'd', or the default type when you don't add a letter after a decimal number) types.

If Rotate() accepts both float and double types, then the code is correct, and Visual Studio is working as intended.

This C# video on methods will help you understand them better if you're still having trouble.

1

u/lix3nn53 Oct 14 '26

That usually means Visual Studio opened the script as a loose file, not as part of your project, so it doesn't know about Unity. In Unity go to Edit > Preferences > External Tools, pick Visual Studio as the External Script Editor, press Regenerate project files, then open the script by double-clicking it in Unity.