How to get current "Target Arm Length" of camera spring arm in Third Person Blueprint Template?
In UE4 Third Person Blueprint Template, I am trying to get the value of Camera Boom's Target Arm Length.
Using the very simple BP below, I am printing the value on screen at every tick.
Problem: When the Camera Boom collides with any object in scene, camera zoom in/out to the character just as expected. But, the value of Target Arm Length somehow never changes!
Question: Is this normal? If yes, what parameter should I check for getting the distance between Camera Boom and the character?
from my undestanding the code, the Target Arm Length always remain the same, but take a look on the:
This function updates protected members (RelativeSocketLocation, RelativeSocketRotation) of spring arm component:
// Form a transform for new world transform for camera FTransform WorldCamTM(DesiredRot, ResultLoc); // Convert to relative to component FTransform RelCamTM = WorldCamTM.GetRelativeTransform(ComponentToWorld);
And they are exposed in BP with "GetSocketTransform" function. You can try call "GetSocketTransform" with RTS_Component parameter and obtain position then compute length of this vector.
answered Oct 06 '14 at 07:24 PM
Here's a way using blueprints. You could probably use a property of the SpringArm itself (instead of "Sphere") to make this more portable.
answered May 28 '16 at 02:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here