Download

Another noob c++/unreal q: How do I refer to member UProperty() variables inside member functions?

Hey gang,
I have something like this in my .h file:


UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = NeonInput)
	float NeonInput_EngineRPM;

Do I need to suffix its name with AClassWhatever:: to use it inside member functions? For some reason I was under the impression that class scope vars could be referred to by their name anywhere inside the class members?

Thanks!

If this is in the class block of the header file, then you can simply use it in the member functions that are also declared in the class block of the header.
But make sure your functions in the cpp file have the “void AClassWhatever::MyFunction(float blat)…”.

If you forget the AClassWhatever in the cpp in front of your functions, then it won’t find the variables of course (:

Ah many thanks! Had forgotten the class suffix in the .cpp declaration of the function, phew!