now the portals exit the player at the same spot they entered on the other portal (if u go into the top u come out of the top too) It now also correctly handles if you have more than one portal pair. Both portals work now. I did find a thing where you can enter a portal in such a way as to exit in the ground. This can most easily be fixed by leaving a little bit more space around the portals.
All I did was the portal script