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 kashif789us · Oct 21, 2013 at 12:36 PM · ontriggerenterontriggerexit

OnTriggerEnter/Exit not called sometimes

Hi, OnTriggerEnter/ OnTriggerExit is not being called sometimes. The scenario is that I have a rigidbody moving with rigidbody velocity. I am setting its y position to fixed such as

 transform.position.y = 200; 

in update function

I also change its transform.position.x and transform.position.z when it collides.

Static Triggers are placed on each corner to tell this rigidbody to move left or right.

But sometimes, ontriggerenter and ontriggerexit are not called.

Triggers are empty gameobjects with box colliders and isTrigger checked.

Just for checking I also added rigidbody and transform.Translate(0,0,0) in update of these static colliders but no improvement.

Rigidbody also has a box collider with isTrigger checked.

What can be the cause. Thanks? I have spent alot of time on it but could not find the solution.

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 KiraSensei · Oct 21, 2013 at 12:47 PM 0
Share

Damn ! $$anonymous$$ost of the people don't format their code, but you format everything :)

avatar image ArkaneX · Oct 21, 2013 at 01:01 PM 0
Share

The problem is tab at the beginning of a line - this is automatically treated as code, and formatted accordingly.

avatar image bboysil · Dec 22, 2013 at 04:55 PM 0
Share

No answer? I also have the same kind of problem... In my case I don't really care if sometimes they are not called, but I care if they are not called in pairs( i.e. OnEnter followed by onExit). I miss one on of the events when I move the object fast through the triggers.

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

17 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

Related Questions

walk through an object once 0 Answers

Can someone please tell me why this code isn't working? 1 Answer

OnTriggerEnter function in c# 0 Answers

Make object react to certain triggers only 1 Answer

OntriggerEnter / Stay with the same Gameobject tags 0 Answers


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