Need help with my teleport script.

CallMeTessCallMeTess Posts: 2Member
edited June 8 in 3D

I'm working on implementing portals, and I have this function for teleporting the player:
global_transform.origin = portal.portaltarget.to_global(Vector3(-1,-1,1)*portal.to_local(global_transform.origin))
When the portals face towards each-other, it works as expected (although when you look behind you there's some clipping that I still need to fix).
But when the portals are facing away from each-other, the player gets teleported to the wrong place.
I feel like i'm missing something obvious. Could someone help?


Tags :

Comments

  • CallMeTessCallMeTess Posts: 2Member

    There were some images in the post that dont seem to be displaying correctly. I've attached them here:
    Facing away from each-other:

    Facing towards each-other:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file