# How to change the up vector of something in Unreal

I'm creating a grapple hook mechanic.

The elements of this particular situation are a Player and a grapple point.

I would like the top of the player to always be pointing towards this grapple point. (the up vector of the player is pointing along the vector to the point).

The default Unreal CharacterMovementComponent is in the falling movement mode right now, and the player's rotation around the Z axis is determined by the movement input. The X and Y rotations are unchanged.

Because the player's position around this grapple point could be anywhere on the sphere of influence of the rope, I never have a definite axis to rotate around to point the up vector towards the grapple point.

How do I achieve something like this?

• Have you tried rotating the player? Dec 3, 2019 at 9:58
• @TomTsagk I've only seen methods to rotate the forward vector of the player, not the upward vector. Dec 3, 2019 at 10:01
• I'm unfamiliar with Unreal, but from a quick search I found the function AddActorLocalRotation which as an argument takes a quaternion, which could describe any type of rotation. Is it worth taking a look at it? Otherwise you might need share with us how you do rotations already, so its easier to suggest something closer to your level. Dec 3, 2019 at 10:05
• @TomTsagk edited the question Dec 3, 2019 at 10:09
• What do you want to rotate and around what axis ? Dec 8, 2019 at 10:10

"How to change the up vector of something in Unreal ?" The answer is simple - to change the upvector you simply need to change the object's rotation.
To make your upvector to point to something - you can use innate function of FMath especially take a look at: MakeRotFromXZ family of functions. docs