I’m trying to create a jumpPad/launchPad effect in my game. Nothing fancy, just a simple boost upwards when the player runs across the pad.
After searching round the forums I came across this script, which seemed to be exactly what I was looking for -
#pragma strict
var moveVelocity : Vector3 = Vector3.zero;
private var thePlayerMotor : CharacterMotor;
function Start()
{
thePlayerMotor = GetComponent(CharacterMotor);
}
function OnTriggerEnter(ThePad : Collider)
{
if (ThePad.gameObject.tag == "JumpPad")
{
moveVelocity = Vector3(0,50,0);
thePlayerMotor.SetVelocity(moveVelocity);
}
}
But I get this error when the pad/trigger is activated -
SendMessage OnExternalVelocity has no receiver!
UnityEngine.Component:SendMessage(String)
CharacterMotor:SetVelocity(Vector3) (at Assets/Standard Assets/Character Controllers/Sources/Scripts/CharacterMotor.js:582)
JumpPadLaunch:OnTriggerEnter(Collider) (at Assets/JumpPadLaunch.js:20)
Any help would be appreciated
???