topical media & game development

talk show tell print

lib-unity-tutorial-platform-start-Assets-Scripts-Misc-Jumppad.js / js



  var jumpHeight = 5.0;
  
  function OnTriggerEnter (col : Collider) 
  {
          var controller : ThirdPersonController = col.GetComponent(ThirdPersonController);
          if (controller != null)
          {
                  if (audio) 
                  {
                          audio.Play();
                  }
  
                  controller.SuperJump(jumpHeight);
          }
          
  }
  
  // Auto setup the script and associated trigger.
  function Reset ()
  {
          if (collider == null)        
                  gameObject.AddComponent(BoxCollider);
          collider.isTrigger = true;
  }
  
  @script RequireComponent(BoxCollider)
  @script AddComponentMenu("Third Person Props/Jump pad")


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.