kayorx
(kayorx)
August 7, 2023, 11:18am
1
Hi,
I want to rotate a mesh to a specific direction that I store in a variable after doing some math. The direction could be either X or Y.
I have the direction vector in a variable.
I want to add 90 to the rotation of the mesh in this direction.
Can someone help me?
Bojann
(Bojan)
August 7, 2023, 11:38am
2
This should do the rotation for you if this object is part of some actor, and you want to do relative rotation inside of an actor
If you want to change world rotation of the object, use this instead of
SetRelativeRotation
RotationSpeed
should be between 0 and 1, and DesiredRotation
is any target rotation you need.
kayorx
(kayorx)
August 7, 2023, 12:44pm
3
Hmm, not quite.
I want it to rotate by 90 degrees (Or another specific value) based on the direction I get (vector) from my math logic.
Basically when I interact with it the pillar rotate by 90 degrees on the opposite direction of the player.
Bojann
(Bojan)
August 7, 2023, 1:20pm
4
Then you can use FindLookAtRotation
and just interpolate to it? It is even simpler. Just make sure your Target
vector is the location at which your object should look at, and Start
is object’s current location.
More info: WTF Is? Find Look at Rotation in Unreal Engine 4 ( UE4 ) - YouTube