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 Griffo · Jul 25, 2012 at 04:07 PM · charactercontroller

Enemy Character Controller

Hi,

I'm looking for some advice, I've got an enemy character with a character controller attached to him and he patrols some waypoints and if the player comes into range he will attack ether by running at you, squatting and shooting or he will shot at you while lying down.

My problem is when the player shoots at him while he is patrolling thats fine because the raycast hits his character controller capsule, but when he squats or is lying down because the character controller capsule stays upright you can kill him by shooting above him and the raycast will detect the capsule.

So any suggestions how best to go about this?

Comment
Add comment · Show 3
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 AlucardJay · Jul 25, 2012 at 07:36 PM 0
Share

you could try some trickery and check if the hit is above the center of the collider, if so then ignore hit. If the contact point is under the center of the collider , do some damage =]

avatar image Mander · Jul 25, 2012 at 07:40 PM 0
Share

try moving the capsule of the CC when the squat animation isPlaying. :)

avatar image Griffo · Jul 25, 2012 at 08:05 PM 0
Share

Thanks for your advice, some trickery by reducing the returned hit hight if squat is true could be the solution.

$$anonymous$$oving the CC down when he is squatting moves the character down to as he's the child.

1 Reply

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

Answer by Justcool25 · Jul 25, 2012 at 07:03 PM

All you have to do is either rotate or scale the collider of the character. That will allow the raycast to pass above the character without it hitting the collider. If the character model is childed to the character controller (which i'm asuming it is...) then you might have to compensate for the rotation/scaling by doing the opposite to the character model itself.

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 Griffo · Jul 25, 2012 at 08:07 PM 0
Share

Thanks I'll take a look at that to ....

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

8 People are following this question.

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

Related Questions

Character Flying around uncontrollably 2 Answers

Prioritizing Player Animations 0 Answers

Click on an object and then edit the speed of my player? 1 Answer

Character controllers against each other 0 Answers

Scripting help 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