Sorry to be a pain. I can prove colliding works as it prints but swapping the forward control to move the player height (as the effect of a ladder) is not working?
Any help would be appreciated. I do realize there are some parts of my code that are not used or make sense but if you could help with this. I would really appreciate it
var player: Transform;
var target : Collider;
var chMotor : CharacterMotor; //Default CharacterMotor script used for control referencing
static var laddercolliding : boolean = false;
function Start () {
}
function OnTriggerEnter(collision : Collider)
{
if (collision != target) //The colliding object isn't our object
{
laddercolliding = false;
print ("Forward = forward motion;no ladder");
return; //Forward key = forward motion
}
laddercolliding = true;
}
function moveUp()
{
transform.Translate(Vector3.up);
}
function Update ()
{
if (laddercolliding == true)
{
print ("Colliding");
if(Input.GetKey("up"))
{
moveUp();
}
else {
}
}