i have just installed the last version of Unity, in addition of the version i already have ( 2018.4.14f1 ) in order to use the Universal RP.
Until now, all is working good except ONE Strange thing :
I have a script linked to a trigger that the player have to walk in. With specific action when OnTriggerEnter. ( instantiate Object, play sound, etc. )
in the previous 2018 version, it works perfectly : It acted only once, just when the player enter the collider ( not stay in ) , BUT, with the same script in 2019 version, it acts like in Update void, repeat the actions every frame !
I can find a solution to that using some bools, but i prefer not, because i don’t understand why it works on 2018 and not in 2019 ? ( i also have a lot of script using the same method, and i don’t really want to correct them one by one, especially if they were working good in 2018 version ).
Have i missed something ? Maybe some setting to do in 2019 version ?
OnTriggerEnter behaves the same as always. OnTriggerStay is the one that should act like Update (Although it actually happens each physics update, not each frame update). Could you sahre a little more details about what’s happening? What’s being instantiated? On which script is OnTriggerEnter being called repeatedly?
Update : Found the problem source, but still coul’dnt find a solution !
For an unkown reason, OnTriggerExit triggers while still in the trigger zone ! That way, the OntriggerStay triggers again, and here goes the loop !
What i really cannot understand is that : It’s the same project, the same scene, with the same scripts ! It works perfectly on 2018 but make this weird things in 2019 version.
OnTriggerStay, it disable the collider of the parent, and OnTriggerExit, it enables it. I Don’t know if it is the source of the issue because it works well on 2018 version.
Will try to work on that ! Maybe the behavior changed with the updated version.
Just tried some different corrections, but the problem remains the same !
I can clearly see that the player ( with a rigidbody and collider) is in the middle of the Trigger Collider, and it doesn’t stop Exit and Enter it !