- Home /
Question by
SilverNinja14 · Jul 08, 2012 at 07:42 PM ·
javascripttransformtouchteleport
Touch teleport script isnt working
Can someone fix this? I have the component in terrain and im new to the scripting aspect of Unity:
function OnTriggerEnter (other : Collider) { other.transform.position = Vector3(1121.029, 55.90824, 937.687); }
Comment
I actually JUST realized I had the collider set so it couldnt trigger. o3o
Answer by animusrecro · Jul 08, 2012 at 09:47 PM
I believe you have to have a rigidbody for OnTriggerEnter(). Note that trigger events are only sent if one of the colliders also has a rigidbody.
Answer by erghard · Jul 08, 2012 at 10:04 PM
Make sure you have Rigidbody or Controller Collider assigned to your player.