Home Unity

UnityScript help (simple script)

polycounter lvl 6
Offline / Send Message
illbleed polycounter lvl 6
Hey there!

I'm working on an assignment for school and i'm having trouble getting some of my scripts to work.

Right now i'm trying this really simple (so i thought) teleporting script.

http://wiki.unity3d.com/index.php/Teleporter

var teleportTo : Transform;
 
function OnCollisionEnter (col : Collision) {
    col.transform.position = teleportTo.position;	
}


I followed the instructions but my character won't teleport.
Do both teleport devices have to have a "is trigger" enabled?
any tips or help will work.
this is what i did..


created two cubes, named both cubes teleport1 and teleport2.
both have a box collider and have is trigger checked.
only one of them have a script attached. Through the inspector i assigned what the teleportTo variable is (the teleport2 cube).


Any help please? This is my second time posting on these forums, but i enjoy the community so far. I was actually referred here by the animation director for Infamous Second Son ^-^.

Replies

Sign In or Register to comment.