Unity 2d simple teleport / Portal

Published: 03 January 2022
on channel: GAW
7,158
145

Learn how to make 2D teleport in Unity

Script:
public GameObject portal;
private GameObject player;


void Start()
{
player = GameObject.FindWithTag("Player");
}

private void OnTriggerEnter2D(Collider2D collision)
{
if(collision.tag == "Player")
{
player.transform.position = new Vector2(portal.transform.position.x, portal.transform.position.y);
}
}


Watch video Unity 2d simple teleport / Portal online without registration, duration hours minute second in high quality. This video was added by user GAW 03 January 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,158 once and liked it 145 people.