seamless portals like in the game portal

The script that I have teleports the player from one object to another with collisions but I’m looking for it to be more like a gateway sort of like in portal where you could have one foot in one and the other foot out the other. Any help or code for this would be greatly appreciated.

using UnityEngine;
using System.Collections;

public class Portals : MonoBehaviour
{
    public GameObject otherPortal;

    void OnTriggerEnter (Collider other)
    {        
        if(other.tag == "Player")
        {
            other.transform.position = otherPortal.transform.position + otherPortal.transform.forward * 2;
        }
    }
}

An effect like this is actually quite difficult and at a minimum might require that you clone and mask part of the character object. It’s not the kind of thing you’d be able to ask on here and get a response where someone codes it for you.

If you wanted a portal to show the area on the other side you would need to work with custom shaders, and it gets even trickier in a first person situation moving the camera through the portal. All this stuff is non-trivial and requires lots of knowledge (especially the shader stuff, which can get pretty esoteric).

It sounds like you’re just starting so I would recommend making your portal mechanic work within the confines of what you know how to do. It seems like you’re on the right track there; If you add an animation for entering a portal that you play when the player collides with a portal, and an animation for stepping out of the portal that you play at the player’s new position, it could be very convincing.

If your game absolutely requires a seamless effect, there may be some asset store solutions that might give you what you want, or you can just dive in trying to figure out how to do it yourself on Google. I found a bunch of info in minutes of searching, including this thread:

Realistically though, I think this will be overwhelming. You’re more likely to finish the game and continue learning if you change the scope to be more inline with your current abilities.