Teleport on collider enter?

I’ve been searching around and I’m not exactly sure what’s going on with my script. im working on a script that as soon as the player enters it teleports you to a game object. heres what I have:

using UnityEngine;

using System.Collections;



public class Teleport : MonoBehaviour

{

    public GameObject objToTP;

    public Transform tpLoc;

    void Start()

    {



    void OnTriggerEnter(Collider other)

    {

        if ((other.gameObject.tag == "Player" && !isPlayed)

        {

            objToTP.transform.position = tpLoc.transform.position;

        }

    }

    void OnTriggerExit()

    {

}

there is no closing brace at the start

Hi @j110113

"I’ve been searching around and I’m not exactly sure what’s going on with my script."

I don’t know what you have been searching for… as you don’t mention anything about your errors or neither do you explain what doesn’t work…

Your script can’t run, as you should see more than one error message.

Like @chucky831 said, you are missing a “}” from one of your code blocks.

And you are also missing another in OnTriggerExit.

And what is that “isPlayed” - you haven’t even defined it anywhere in your script.

Check your Console window for errors.