Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by AlejandroBoss · Mar 02, 2017 at 07:17 PM · transform.positionmove an objectfps controllerclimbladder

How to make a ladder script for unitiy's FPS controller?

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Scoutas · Mar 02, 2017 at 07:39 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

65 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trying to get FPS ladder script to work 1 Answer

Climbable ladder for 2D game 2 Answers

How can I move an object to a clicked objects (center of X,Z) coordinates (board game)? 0 Answers

Player Climbing a Ladder? 1 Answer

Climb ladder 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges