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 MagicoCreator · Dec 30, 2013 at 11:16 AM · physicstriggercolliderscollisions

Inconsistent Trigger events

i'm developing a game for android, and i have problems with triggers, i want to do certain actions if a character touches certaion spots, but the OnTriggerEnter function gets called quite randomly.My basic setup is a non-static animated character with rigidbody and a capsule collider, and other non-static objects, with box triggers on them, usually they intersect for 5-10 frames or more and yet sometimes the function gets called and sometimes not

A concrete situation: i attached box triggers to my characters feet and have a runnning animation, OnTriggerEnter i instantiate a footprint, sometimes he can step 3 times consequitively leaving a footprint behind, and sometimes he can take 5 steps without leaving a single one, the animation is looped and quite symetric (same penetration values) and the trigger and the collider intersect for 5 frames at least, and the terrain is absolutely flat (made out of box colliders)

it also happens in other situations, the only temporary fix i found is raycasting, but its not to convenient to use

Comment
Add comment · Show 5
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 Subhajit-Nath · Dec 30, 2013 at 11:46 AM 1
Share

$$anonymous$$aybe a bit off-topic, but if are using $$anonymous$$ecanim for animation system, then you can use curves to achieve exactly what you are looking for.

avatar image MagicoCreator · Dec 30, 2013 at 11:52 AM 0
Share

could you please explain this a little bit?

avatar image Subhajit-Nath · Dec 30, 2013 at 12:02 PM 1
Share

Using the $$anonymous$$ecanim animation system, you can trigger different events using the curve values. Say, you want foot step sound, you can do that by drawing a simple curve according to the animation and add sound according to the curve values. And with this system you can do foot prints as well. :)

Further reading >>>

http://unity3d.com/unity/animation

http://docs.unity3d.com/Documentation/$$anonymous$$anual/$$anonymous$$ecanimAnimationSystem.html

http://video.unity3d.com/video/7362044/unity-40-mecanim-animation-tutorial

avatar image MagicoCreator · Dec 30, 2013 at 12:13 PM 0
Share

oh you meant the footprints, thanks i never thought of that, though i don't have Unity Pro currently, so can't do it with curves, but now you mention, i know when the foot touches the ground, so i can use Animator.normalizedtime to spawn my footprints. Even so thats one problem out of the way. Thanks!

avatar image Subhajit-Nath · Dec 30, 2013 at 12:18 PM 1
Share

Happy to help.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by TheShadowblast123 · Dec 31, 2013 at 09:33 AM

I found OnTriggerEnter to Always be the "glitchy one" you could use OnCollisionEnter and turn off the collider off imidately afterwards from the type of game it sounds like your making

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 MagicoCreator · Dec 31, 2013 at 12:11 PM 0
Share

it's not a viable solution for my game, and even if they are not used as triggers the problem remains

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

20 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

Related Questions

More realistic physics? 0 Answers

Triggers not being called 2 Answers

Ignore collisions with self but still trigger with self 2 Answers

Gameobject not registering collisions 1 Answer

Child Object's collider setting off triggers 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