I’ve been trying to set some floats and FVectors for a gate door and I’ve tried using the same code as in the door rotation, but I keep making Unreal crash, then rebuild everything, then fail again. It’s been a few good hours now and I’d like some help. So, if an FRotator holds the XYZ rotation coordinates, what holds the XYZ for the position/location?
The code I’ve tried that crashed Unreal several times was
float InitialLocation = GetOwner()->GetActorLocation();
UE_LOG(LogTemp, Error, TEXT("The object is at %f"), *InitialLocation)
Note: I’ve also tried %s
or GetActorLocation().Z
When I try to compile it crashes. I don’t even know why. I tried deleting the component and made a new one in hopes it will work. When I try to initialise the float in the header float InitialLocation;
at private, then add the code I wrote above it just crashes. I don’t even know what is happening. Can anyone point me into the right direction? Thanks!