Teleporter

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m (Applied code formatting and fixed indentation to spaces.)
Line 3: Line 3:
  
 
== Teleporter.js ==
 
== Teleporter.js ==
 +
<javascript>
 
var teleportTo : Transform;
 
var teleportTo : Transform;
 
 
function OnCollisionEnter (col : Collider) {
 
function OnCollisionEnter (col : Collider) {
+
    col.transform.position = teleportTo.position;
col.transform.position = teleportTo.position;
+
}</javascript>
+
}
+

Revision as of 17:31, 2 April 2011

This script works like the halo Teleporters, but you can shoot rockets in to it and it come out the other teleporter Have fun with it. BY Ryan Davis.

Teleporter.js

<javascript> var teleportTo : Transform; function OnCollisionEnter (col : Collider) {

   col.transform.position = teleportTo.position;	

}</javascript>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox