I am trying to set up a portal system, but when I try to set my rotation according to how I should be coming out of the portal it only seems to work half of the time. If needed I can send project files. It works by subtracting the character’s rotation and the enter portal’s rotation, and then adding that to the exit portals rotation to find the proper rotation for the character.
I have tried making a script that double checks my new rotation and if it isn’t correct it reruns the rotation script, but that changed nothing. Also if I inch into the portals it rarely fails, but if I sprint into them it almost always fails.
Just checking, did you set the rotation on the player, or using SetControlRotation?
I did set control rotation, but I think I ran into a bug in Unreal, I found that if I disconnect the SetActorLocation node the rotation works perfectly as if I were coming out of the correct portal, just without actually teleporting, but then if I re-connect the location node it starts randomly breaking
Ignore this comment, it is old and only just appeared
This worked, Thank You!
I have had some problems of this nature myself, but…
Instead of doing a bit of vector math to find out how to put the player ( you could be coming up against gimbal lock problems ), why not have a directional component in the landing portal ( like an arrow ). Just point the arrow the way the player should be facing and boom, all you have to do is set control rotation to be the same as the arrow…