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 4illeen · Dec 16, 2011 at 07:53 PM · movementdetectionedgeclimb

Gothic-like climbing and edge detection

alt text

I'm using edited FPSWalker Enhanced script for my 3d movement - it uses character controller and I may paste it here if it is needed for anything. As subjects says I'm trying to make a climbing script which in use would look like the one seen in Gothic game series. I hope those few points and the pictures will clearly illustrate what am I talking about.

  1. Player presses the climb key and capsule checks if there is an obstacle in front of it - first I thought about raycasting, but I think making a box collider in front of Player will do better in this case, because as we can see in the red box, climbable obstacles may be short (a), tall (b) or short but above the ground (b) - the box collider will detect all of them.

  2. Second thing - I have no idea how to do this - is to check either if the obstacle has a surface player may stand on, or an edge he can 'catch'.

  3. Next thing to do is to check the distance on z axis between the edge/surface and player's center of the mass (or any other fixed point). If it is smaller than float _reach, then the climbing can be performed.

  4. Climbing itself is simply a)temp movement and gravity blockage b)moving player up for distance + 1 (to be sure) and moving player forward for let's say 1. Then unblock movement and gravity.

I'm not familiar with all C# and/or Unity commands, therefore if you have any observations and ideas please do tell. Especially on the subject of edge detection, as I can't think of any solution. Thank you all in advance

PS - There might be some suggestions about marking climbable objects somehow - tagging, or putting them on one layer. I'd rather not, because as you can see on the poorly drawn picture point 4, I want to be able to detect terrain edges as well.

Comment
Add comment · Show 1
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 4illeen · Dec 16, 2011 at 09:54 PM 0
Share

Second question here - for 'jumping over/sliding under while running' script I want to be able to check if the obstacle is either a) from red box or c) - a) is the same as in question above, but for c) I'm going to need to check if there is enough space under an object for player to fit, so that the slide can be done automatically when player is running (either bool Sprint is true or Shift key held down)

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

C# How to Detect Edges of a Collider 0 Answers

Continuous touch detection problem. 0 Answers

Edge crossing detection 1 Answer

Collision error 1 Answer

Making a bubble level (not a game but work tool) 1 Answer


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