I am making a place that I would love for the player to be able to get up there with a ladder. I am using the FPS controller that Unity already has premade in its assets characters. It is the one that says FPSController and NOT RigidBodyFPSController. I’m not even sure that matters but I thought I would include it. I have looked and looked around for videos and articles but they don’t really help me, they’re mainly for 3rd person. I don’t mind if the script is in Javascript, but I’d prefer C#. I’m a sophomore and need this to help me with getting a grade for a game in history class. I’ve coded a few scripts here and there so I have some knowledge and know how to edit code to do as I wish, but I’m not too good. Please don’t say “Go learn to code better first then come back with that question” that is so annoying and unhelpful not only for me but for those who are also wondering. I ask this now because all of the other tutorials are not for unity 5 and they have something different. If you would direct me to a video, or article with step by step insctructions that would be great. I would also love a script that does what I’m looking for. I didn’t explain what I would want it to do, sorry. I have a fps and a cube that will serve as my ladder. I want the fps controller to be able to pretty much climb the ladder. I’m sure that the script would have to somehow move the fps controller along the transform in an up direction. I do want the character to be able to get off the ladder when they reach the top or bottom. Thank you for your help, and PLEASE don’t say unhelpful things like learn to code or something along those lines. Thank you. I will be as clear as possible.
I would say, you’d have to have an enum states somewhere in the code, which would tell the controller, how it’s supposed to move.
Say, the enum has states GROUNDED and ONLADDER.
You could write a simple if statement, or a switch which would execute code, dependant on the state.
When on the GROUNDED state, you could use the basic FPSController movement. Then, for example, you’d create a trigger object near a ladder, and when you cross it, it would change the state to ONLADDER, which then would execute a code for climbing up and down a ladder (e.g. pressing forward would make you climb up, pressing downward would make you climb down), and pressing some button would make the player get off the ladder.
This is the basic method I would use, but in the end, you’ll need to mess around with the code a little bit, find a way to make the player get off the ladder, when they are at the top of it, and when they are at the bottom of it and all that. It shouldn’t be that complicated, really, but if you can’t figure everything out, shoot a comment, I’ll try to help you figure it out.