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 matteonite · Feb 16, 2015 at 02:13 AM · c#triggerweaponcollison

Mob not detecting weapon trigger.

I have a game setup where the player has a weapon that has a box collider that is a Trigger.

It also has a rigidbody. I've played around with the settings of the rigidbody. I've changed the angular velocity, the isKinematic bool, I have set it to discrete, and continuous dynamic and dynamic.

The mob has a character controller.

It doesn't register the trigger enter for some reason.

The mob also has a weapon with a box collider and it can hit the player no problem.

Both are also continuously moving very very slightly in the update, so little a person doesn't notice. I added this so it better detects collisions.

The mobs weapon has no rigidbody and works.

Yet the players weapon even without a rigidbody will only be detected rarely after attacking continuously with or without a rigidbody.

Sometimes the player weapon works sometimes it doesn't.

If you need more info or have information let me know. Thank you.

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
0

Answer by team_eden · Feb 16, 2015 at 02:27 AM

You should be careful, and Particular, when and how you use collisions. Certain conditions need to be met, depending on which style of detection your going to use. Firstly, make use of debug.log, and check collapse, in the console window. This will prevent alot of frame lag. Just monitor those numbers on the right, and if it changes, you got a winner.

Second, your using something like collision.hit, that may run indefinitely, if the colliders are still in contact. You should try something more controlled like OnCollisionEnter, then only the first contact counts, until the colliders are no longer in contact.

After that, if it only collides once, you need to make sure the colliders get a chance to 'reset'. You can do this by checking if a collision occured, and setting a timer to manually allow another OnCollision event.

GL!

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

19 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Trigger Activated Multiple Times From One Click 2 Answers

Guides or Tutorials for a Very Basic Enemy AI? [Unity 5] 1 Answer

OnTriggerEnter Not Working 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