Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class teleport : MonoBehaviour {
- // Use this for initialization
- void Start () {
- /* Confirm that the script is loaded */
- Console.write("Loaded teleport Script");
- }
- // Update is called once per frame
- void Update () {
- Console.write("Frame Sent");
- }
- //Destination position
- public GameObject Destination;
- // When trigger is triggered
- void OnTriggerEnter(Collider other) {
- Console.write("Collition detected");
- // If the trigger detects the player
- if (other.gameObject.tag == "Player")
- // Move Player to Destination position
- other.transform.position = Destination.transform.position;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement