I have simple portals that teleport you somewhere as soon as you enter them, as a simple on player enters portal: - teleport portal.destination. It works, but causes it to be "a real teleportation". I want it to me more natural, thus preserve pitch, relative yaw, and momentum.
The pitch is simple, can just pass it directly as <[LOC].with_pitch[<player.location.pitch>]>.
The yaw should be pretty simple, tho a bit more tricky. I can know the portal's direction (east-west or north-south), and the destination location's yaw. This means I can do simple math to preserve the player's facing direction (i.e. if the player enters a portal looking 30degs to the right, I can add 30degs to the destination's yaw).
For the momentum, no clue. If the player is running in the portal, I want the player to keep on running after the teleportation.
I also don't know if Denizen is hiding some kind shortcut for that working out of the box.
Any idea on how to proceed for the momentum thing, or know a shorthand ?