I’ve been experimenting a little with the TeleportTo function withing verse FortCharacter.TeleportTo[]
however it doesn’t seem to apply Z axis rotation to the FortCharacter(XY seems to work). Is my NewRotation wrong? or is there a bug in TeleportTo?
Here’s my code of making the player face a nearby object
if (LookDirection := (NearestObject - PlayerLocation).MakeUnitVector[]):
Yaw := RadiansToDegrees(ArcTan(LookDirection.Y, LookDirection.X))
Pitch := RadiansToDegrees(ArcTan(LookDirection.Z, LookDirection.X))
// Pitch := RadiansToDegrees(ArcTan(LookDirection.Z, Sqrt((LookDirection.X * LookDirection.X) + (LookDirection.Y * LookDirection.Y)))) no difference?
Roll := 0.0
NewRotation := MakeRotationFromYawPitchRollDegrees(Yaw, Pitch, Roll)
if(FortCharacter.TeleportTo[FortCharacter.GetTransform().Translation, NewRotation]):