Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 TheRichardGamer · May 26, 2013 at 04:46 PM · lerp

How to make a ladder script

Hi, I am trying to do a ladder script for my game, but my script dosen't work.

Is there anything wrong with this script? My player falls through the ground and stuff with this script.

Script:

 public var smooth : float;
 public var Ladder : boolean = false;
 
 
 public var newPosition : Vector3;
 
 
 
 function Awake ()
 {
     newPosition = transform.position;
     
 }
 
 
 function Update ()
 {
     PositionChanging();
     
 }
 
 
 function PositionChanging ()
 {
     var positionA : Vector3 = new Vector3(576.3549, 17.97417, 174.8432);
     var positionB : Vector3 = new Vector3(583.3901, 57.30544, 174.8432);
     
     if(Input.GetKeyDown(KeyCode.W))
         newPosition = positionA;
         
     if(Input.GetKeyDown(KeyCode.S))
         newPosition = positionB;
     
     transform.position = Vector3.Lerp(transform.position, newPosition, smooth * Time.deltaTime);
 }
 
 
 
Comment
Add comment · Show 6
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
avatar image bodec · May 26, 2013 at 04:56 PM 0
Share

Do you fall throught when you start or when you hit a button please be more specific with what is happening.

avatar image TheRichardGamer · May 26, 2013 at 05:02 PM 0
Share

I fall through at start.

avatar image bodec · May 26, 2013 at 05:09 PM 0
Share

in your awake function you assign position to transform.position make sure that is the right position sounds like you are assigning yourself below the surface.

avatar image TheRichardGamer · May 26, 2013 at 05:12 PM 0
Share

$$anonymous$$y first person controller just goes down through the floor, and I have not placed it inside the floor.

avatar image bodec · May 26, 2013 at 05:17 PM 0
Share

pull your controller up off the ground if its slightly in the ground it can fall throu

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FL · May 26, 2013 at 05:26 PM

If you can stand over the ladder without the script, so you needs to raise a little the y positionA/B coordinates.

If you can't, so you needs a collider for your ladder.

How to make a ladder: http://answers.unity3d.com/questions/9931/how-do-i-create-a-climbable-ladder.html

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

14 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

Related Questions

How to lerp between cameras on a UI button click? 2 Answers

Why is .Lerp so bumpy? 3 Answers

Smooth Camera Angle Scroll 1 Answer

How to move along a group of waypoints at a certain speed? 2 Answers

Move an object through a set of positions 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