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
4
Question by Squibel · Feb 10, 2011 at 08:53 PM · physicstriggerparenting

Version 3.2 gives no OnTriggerExit when collider is parented

Hi,

I'm now having a problem in my game since the upgrade to 3.2: in my elevator algorithm I parent my player to the elevator gameobject in the OnTriggerEnter function. But when this has happened, I don't receive an OnTriggerStay, nor an OnTriggerExit call anymore.

Is this normal behaviour since the update, and if so, what is the best way to solve my problem? Since I unparent my player in the OnTriggerExit call, but now I don't get that call anymore at all!

Thanks in advance, Lieven

Comment
Add comment · Show 2
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 AngryAnt ♦♦ · Feb 15, 2011 at 02:42 PM 0
Share

So did you parent the collider to a transform tree with a rigidbody in it? And what is it failing to collide with?

avatar image Danilo Nishimura · Mar 25, 2011 at 05:27 PM 0
Share

Still waiting for some documentation regarding this issue... Unity should warn the users about what happened and how to proceed. $$anonymous$$y project broke and I have something about 2 weeks to deploy my application and everything regarding this trigger stopped working. I had to revert the whole thing to 3.1... I paid for the Pro version, I should have the program updated but I can't, and it's not my falt.

12 Replies

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

Answer by Dinart Filho 1 · Feb 17, 2011 at 03:57 AM

I found a "band aid" solution, is to "force" the "ontriggerexit"

how so?

you can make the Update function check if it is still colliding and use just the "OnTriggerStay" function instead "OnTriggerEnter and OnTriggerExit" so my solution was to make the script deny every 0.2 seconds if it is still triggering.

in my exemple when the object.tag is "platform" the playerscript parent the player to the object with "platform" tag so the "onTriggerExit" doesnt work anymore and the character cannot be free from the platform, thats my solution.

Exemple here:

//======================================================

var accept = false;

function Update(){

if(!accept){

gameObject.tag = "objetocomum"; print("untagged"); }

if(accept){ gameObject.tag = "platform"; accepted();

} } function OnTriggerEnter (other : Collider){ if(other.gameObject.tag =="Player" ){ accept = true; } }

function accepted(){

print("tagged"); yield WaitForSeconds (0.2); accept = false; }

//======================================================

I used the "print" to be sure that it was working, dont forget to add some tags to make it work.

It isnt the solution but is a good way to keep developing on 3.2 before they dont give us a final solution.

and

Sorry to make your question a monologue, I hope it help you.

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 Squibel · Mar 01, 2011 at 10:29 AM 0
Share

Thanks for the possible solution, I'll keep that in $$anonymous$$d for the future. The project I was busy on had such a tight deadline that I decided to downgrade eventually.

avatar image
1

Answer by jonas-echterhoff · Feb 14, 2011 at 08:17 AM

One change in 3.2 which might affect this is the following bug fix:

Parenting a collider to a rigidbody at runtime will now correctly add it to the rigidbody.

In previous Unity versions, parenting colliders to rigidbodies at runtime did not properly attach them, so the result would be different then when parenting while editing. Without having an example project of what exactly has changed for you, it's hard to tell if this is the actual issue, and what would be the best way to work around it, though.

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
avatar image
0

Answer by Teragram · Feb 11, 2011 at 09:07 PM

Since I upgraded to 3.2 I am having the same problem with my elevator un-parenting. Even the Debug.log does not return anything to the console when function OnTriggerExit is called. Is this a bug? It was working perfectly before the 3.2 update. Anyone has a fix?

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 AngryAnt ♦♦ · Feb 15, 2011 at 02:43 PM 0
Share

Same question as for OP: So did you parent the collider to a transform tree with a rigidbody in it? And what is it failing to collide with?

avatar image
0

Answer by Dinart Filho 1 · Feb 13, 2011 at 01:59 AM

Same problem here, I am downgrading right now.

No UnTriggerStay, no UnTriggerEnter and no UnTriggerExit

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 AngryAnt ♦♦ · Feb 15, 2011 at 02:43 PM 0
Share

Same question as for OP: So did you parent the collider to a transform tree with a rigidbody in it? And what is it failing to collide with?

avatar image
0

Answer by Dreamora 1 · Feb 13, 2011 at 07:57 PM

didn't have any problem with ontrigger stay on my iPad project nor the desktop project

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
  • 1
  • 2
  • 3
  • ›

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

1 Person is following this question.

avatar image

Related Questions

My script doesn work Trigger Problem!! HELP!! 3 Answers

OnTrigger outside the trigger and collider gamobject 1 Answer

If trigger hit, spawn it 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Question about collision and trigger 2 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