I have searched all over google and youtube trying to find some sort of tutorial on 2.5d ladders. I cant find anything!? So I created a model, which would be the ladder, and I created a second box larger with no mesh render that collides with my character. The box is called “LadderClimb” The ladderModel is more in the background just for appearance. I then put together this script
LaderClimber.js
var prefabTarget : Transform;
function OnTriggerEnter(theObject:Collider){
if(theObject.gameObject.name==“LadderClimb”){
prefabTarget.transform.position.y += 500;
Debug.Log(“found ladder”);
}
}
I attatched the script to my character and then set the ladderClimb (with no mesh rendering) to a prefab and linked that prefab to this script on my characters inspector menu. I know I do not have a button press to transform the character currently. I just wanted the ladder to move my character in proof it worked first. It does not. Any help would be greatly appreciated. Example scripts for 2.5d or anything. I will create a youtube tutorial if I can get this working. It is hard to believe no one has created tutorials in 2.5d for this.
I got it working in a slightly different way. I don’t know where your problem is, so here’s some thoughts:
All objects zeroed in the z-axis?
Is Trigger checked on LadderClimb?
Tried adding a Configurable Joint to the player so that he can’t move in the z-axis?
Man that definitely works! thank you so much. this would be a great script start for springboards as well. now let me ask you. if we turned that down to say .3 or even 1…how could we make it “climb” up rather than teleport upwards? and not only on collide but when say the up arrow is key pressed.