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 Gameart1235 · Oct 28, 2016 at 03:34 PM · third-personthird-person-controllerthird

Unity Third Person Script - Help

I'm making a game using Unity Third Person Script. And everything is awesome. But I ran into a problem that I don't know how to get around. And I try everything to fix it, but no luck.

Number 1 Went the character under a door or between room he auto crouch.

Number 2 How can you get the player to walk up stairs or slope he just shoot up them.

Plz Help.

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
1
Best Answer

Answer by oStaiko · Oct 28, 2016 at 03:48 PM

Alright, I'll go over a few ways you can do this, so pick whichever one works best for how you built the game. You can use a NavMash to chooses 'areas' such as places where you might need to crouch, and then have a script that makes your character crouch whenever hes in those areas. This would work best for static maps, and if you don't mind setting it up for all of your maps. Another way would be to have a 'double' collision box system. The bottom one would work just like you currently have it, and the top one would activate crouching. More specifically: the top box would represent the difference in height your character has when crouching. So if anything touches the top box but not the lower one, they crouch to pass through. Just make the top box a bit smaller so it doesn't crouch if it runs in to just any wall ya know. If you use projectiles and need the entire hitbox, make sure you deactivate detection on the top box if the player is crouching! A final way would be to use a short Raycast from close to the top of their head, and if it hits something then crouch. That's basically the same as a hitbox though. These last two methods work on all types of maps, but the first one only works on static maps, and really you should only use it if you already have a navmesh set up.

Secondly, stairs work the same as the navmesh described above. set a zone for stairs and have a script do the rest if in those areas. Otherwise, you can tag the hitboxes for the stairs as "stairs", and use in your script, if the player is therefor waling on a hitbox tagged 'stairs', have the script run a "look up" code. Either way looking up and down would be tough, because that doesn't detect if the player is going up or down the stairs. I'll leave that part to you! (Maybe have a hitbox in front of the player and check if that collides with the stairs. If he is going down, it'll be in the air and wont collide.

Comment
Add comment · Show 3 · 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 Gameart1235 · Oct 28, 2016 at 05:17 PM 0
Share

thank you so much for the help.

avatar image oStaiko Gameart1235 · Oct 28, 2016 at 06:04 PM 0
Share

Thank you, but don't forget to mark an accepted answer to help anyone else who has the same problem find this answer too.

avatar image Gameart1235 oStaiko · Oct 28, 2016 at 06:52 PM 0
Share

I forgot, I do it now.

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

58 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

Related Questions

Why the ThirdPersonController is floating in the air when using Nav Mesh Agent ? 0 Answers

Switching/Picking up items in a third-person game 2 Answers

How to create a 3rd person character 4 Answers

How do I get camera and movement controls for third person multiplayer to work correctly? 0 Answers

How to make camera rotate around player and move the player relatively 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