Location is not readable from memory

Hi guys I have came across an issue where I am not able to read a memory address from my FVector variable Location. When I have included it in the header file and instantiated it through the constructor.

.h file

.cpp file

Care to share a little bit more about how you’ve declared this in your header file and what the exact error is you’re receiving?

Not sure what you’re doing here, it’s unsafe to call GetActorLocation() in a constructor because it may not even have a valid RootComponent yet.

Even so, that’s not how you set the location member variable. Right now you are setting another variable called ‘location’ that you are creating locally in the constructor. All you need to do is:

location = GetActorLocation();

I would suggest following some C++ tutorials and studying the existing engine C++ examples.