Hi Guys,
I am currently attempting to reference an attached spring arm that is a child component of an actor. See image:
From the UOrbitalCamera class, I have declared a pointer to the Spring Arm like this:
In the beginplay function, I attempt to find the SpringArm, and added some validation to protect against a null pointer. It compiles fine, and When i run the game, I can see the output confirming that a SpringArm has been found.
I have another, public function called “Zoom”. This is called from another class. I have confirmed that the function is being called successfully, because of the UE_LOG output during runtime. However, at this point it appears as though the pointer has reverted to a null pointer??? The validation prevents a crash but If i remove it, the editor crashes, and I assume that I encounter a nullptr ex…
I really have no idea why this isn’t working, I am new to C++ and may have missed something but this does not seem to be the case…
It might be worth noting that when I tried to expose SpringArm as a UPROPERTY(EditAnywhere) and reference the component in the editor, there was no SpringArm available in the drop-down menu. Maybe that is related.
Thanks,
S