OnMouseEnter Error

Hi, In a level I am currently making I need the player to teleport once they look at an object.
I have this script currently. (in Javascript)

#pragma strict

function Start () {


function Update () {


var destination : Transform;

function OnMouseEnter (other : Collider)

 if (other.tag == "Player") {
        other.transform.position = destination.position;

However, once I run the script after attaching it to the object and putting my mouse on it, I get the following error:
Failed to call function OnMouseEnter of class HoverBotTeleportPlayer
Calling function OnMouseEnter with no parameters but the function requires 1.
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32, Int32)

If anyone could explain why this happens and tell me how to fix it I would be extremely grateful.


Thank you. Basically I want the player (first person) to be teleported somewhere once he clicks on ANOTHER object.
So if I move my mouse on a chair, I get teleported to my bathroom.

Does your code work with that concept?