Skip to content

Commit ec772fb

Browse files
authored
Create Teleport.cs
1 parent c0f89f7 commit ec772fb

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

UltimateTeleport/Teleport.cs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class Teleport : MonoBehaviour
6+
{
7+
public string triggerName;
8+
public Transform 3dClxviClwnPort_;
9+
public Transform 2dClxviClwnPort_;
10+
11+
private void OnTriggerEnter2D(Collider2D dclxviclan)
12+
{
13+
if(dclxviclan.CompareTag(triggerName)
14+
{
15+
dclxviclan.transform.position = 2dClxviClwnPort_.transform.position;
16+
}
17+
18+
}
19+
20+
private void OnTriggerEnter(Collider dclxviclan)
21+
{
22+
if(dclxviclan.CompareTag(triggerName)
23+
{
24+
dclxviclan.transform.position = 3dClxviClwnPort_.transform.position;
25+
}
26+
27+
}
28+
29+
30+
}

0 commit comments

Comments
 (0)