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
2
Question by inglipX · May 01, 2013 at 05:52 PM · animationclimb

how to grab ledge and climb up

Hi i am using a rigidbody controller and i want to make the player be able to go next to a wall, jump, then latch on the edge and only climb up if u press w. How can i do this thanks?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Fornoreason1000 · May 01, 2013 at 08:21 PM

there are lots of ways on going about this... one way is to use heavy ray casting to determine if the ledge is "grabbable" by checking its height then setting the players Animation and position accordingly. you could also do it but adding tags to the walls you want climb and and checking if the player is near enough to the walls and jumping high enough to grab on. you could use empty markers to position the players handles more realistically. you probably need to strategically model these edges for this purpose.

personally i would use a combination of the last two i mentioned. that way by using the marks and player positioning and can grab on to edges that are hanging over like a collapse bridge. it also allows me to make certain edges un-grippable, like electric fences.

one you have determined the edge to be scaled, you can then check for the W input to make them grab hold. to make them do this, just make an animation and lerp them toward the edge. to stop them from falling you can turn off gravity or add an opposite force .

now you may want them to move side to side, this gets a little harder but they empty markers become allot more useful here. as they can direct if the player can go there or not. and more importantly rotate and re position the hands when shift around rounded edges.

now to make them climb up... this can be easy, depending on you game design. personally id make the game check if you can actually climb up it, in case your holding on like a pipe or a small ridge and you player doesn't to climb up on it lol. you can do this by raycasting some more. if its clear and the player can proceed, just make a animation the make the player jump/climb up while moving them off from the edge(so they don't fall back down), once there on there feet you can re-enable gravity or disable to anti gravity force i mentioned earlier help it helps

Ray casting:

http://docs.unity3d.com/Documentation/ScriptReference/Physics.Raycast.html

http://docs.unity3d.com/Documentation/ScriptReference/Plane.Raycast.html

http://docs.unity3d.com/Documentation/ScriptReference/NavMesh.Raycast.html

http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html

http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-useGravity.html

Comment
Add comment · Show 2 · 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
avatar image inglipX · May 01, 2013 at 09:17 PM 0
Share

thank you, but i am not an experienced coder :( I do not know "lerp" and my attempts at scripting an animation are terrible. I have little experience with raycasting also :(

avatar image iwaldrop · May 02, 2013 at 02:57 PM 3
Share

$$anonymous$$y suggestion would be to become a more proficient coder, and to learn the Unity API, before you attempt more complex actions like this. Practice your animation skills, raycasting, and translating of rigidbodies around the game world for a bit. Think up different scenarios, and try to achieve them. Have fun along the way, and don't take such a rigorous approach to building your concepts; in other words, allow yourself to feel free and to play while learning.

avatar image
0

Answer by jonnytracker · Jun 22, 2020 at 12:42 AM

I tried this with climbing animation. And it snaps back to old position. Like the physics collider is not following the climb animation

Comment
Add comment · Show 1 · 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
avatar image Anikate · Mar 26, 2021 at 03:55 PM 0
Share

I've been through the same problem while trying to make a ledge climb system. So, I'm guessing that you probably have Root motion enabled on your character climb animation. Due to this, the skeleton of your character is moving but the colliders or the controllers are not. I fixed this by transitioning to a Crouch animation once the climb animation is over and then moving my character (it's transform to the desired position) I made an empty child object and set it's local position to what I needed and then translated to this pos with a script. Both of these are happening in the same video frame.

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

17 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

Related Questions

A node in a childnode? 1 Answer

Play Two Animations Simultaneously using Animator 2 Answers

Need help with some OnTrigger Scripting 2 Answers

Creating an animated raising "force field"? 1 Answer

Why is my animation not being played? 0 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