Header Variables not color coded in VS2019?

I’m following the Unreal C++ course, and I’m doing it in VS2019 instead of VSC. I’m specifically at the part about writing a lerp method for the door.

My problem is, even though I declared private variables in the OpenDoor.h header file, they’re not being color coded in the cpp file. As seen here:

The code compiles and runs fine, but I don’t like how the CurrentYaw, InitialYaw and TargetYaw variables remain white. They were declared as float variables in the header, just like in the video.
Every time I declare a variable in the cpp file, it gets color coded properly (see int testvariable), but it doesn’t seem to want to for the header.

Is there a way to fix this?

They aren’t supposed to. The blue colour is for local variables. Member variables are a different colour (white in this case) to help differentiate between them and local ones.

If you really want to change it you can change colours via Tools > Options > Environment > Fonts & Colors.

C/C++ Fields = Member variables.
C/C++ Local Variables - …
C/C++ Variables = Global variables

Ok thanks. Just seemed strange to me because in the video they change to blue

Then again, I suppose it’s a different program.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms