- Home /
Moving Through a Portal With Body on Both Sides
I've been playing around with some portal-like stuff and wondering how you could create a portal that doesn't simply set the position of something but actually moves stuff through it kinda like the picture below.
In the picture the character (represented by the circle) is moving through the portal and exists on both sides as it passes through. How would something like this be accomplished within Unity?
There's different approaches to this problem. $$anonymous$$ost of them imply duplicating stuff.
Either you duplicate the object while it's going through the wall. (deleting the one that ends up outside the room) OR you duplicate the room where the portal is.
But the object seem to be the smaller problem, compared to moving the first person character (more precisely its camera) through the hole.
Search the web a bit, I remember finding something treating this issue, can't recall, but here's a quick starting info : http://answers.unity3d.com/questions/123547/seamless-portals-into-other-spaces.html
If I were to attempt this, I would agree with Jokim.
$$anonymous$$aking a dupe of the player and shifting the Camera at the right time would sound like a good start, perhaps an EmptyObject could be used to reference the cameras location, and when the Camera comes to the wall of the Portal, then it is quickly shifted to the same orientation and placed at the other EmptyObject as it is co$$anonymous$$g through the wall.