TL:DR Why are the Ontriggerstay events still being watched and listened for even after changing to Enter/Exit? The profiler still has them there after changing to a different mode.
I stupidly designed a inventory system with on trigger stay and then realised when the game will have hundreds of prefabs spawned in it could get very slow when checking for on triggerstay all the time and the profiler proved that with a 5 ms slow down.
SO I designed it a slightly better way and switched all the FSM trigger actions to on trigger enter/exit just like I read Jean Fabre say in here somewhere. (something like always use trigger Enter/Exit over the trigger Stay for performance). I do not use the SYSTEM events like ONTRIGGERSTAY or any of the Unity system events. I only use the Actions from the action menu.
Well after switching back to Ontrigger Enter/Exit performance didnt get much better at all.... I still saw the lag in the profiler under Playmaker.Update OnTriggerStay and it was the same time about at about 5 ms.
So when I changed the onTriggerStay to onTriggerEnter/Exit in the Action dropdown..... Why does the PlaymakerTriggerStay.cs script still show up on the the action at runtime? is there a reference stored or something? Because after trying each of the trigger modes for one or two tries in the editor (Enter, Exit, and Stay) now all those scripts are stacking up in the component list at playtime.... causing a whole bunch of lag.
I went through my HUGE 40 gig project and made sure there are no OnTriggerStays in the project at all.... I dont get it. They still show up in the profiler and the CPU usage is way way too high now. It says there is over 1100 of them and they are 50% of the load of the entire game?
And then when I click on the script (PlaymakerTriggerStay) that is automatically put on the prefab at runtime even though I am not using it. (im assuming to proxy the events to unity) it just goes to the Playmaker.dll and I cant do anything anyways.
When building the prefabs I just copied the "many times tweaked" FSM with a right click on the component in the inspector and then copy it to the other 30 prefabs in the project folder by highlighting them and them right clicking on the inspector and paste as new. I have 35 prefabs objects that I build at once and each has four FSM's on them. Been doing this for 8 years now and never had a problem.
Should I try rebuilding the FSM from scratch and then hope it doesnt load the On trigger stay .dll scripts on them?
I even tried deleting the PlaymakerTriggerStay scripts from the game objects at runtime but that just make it worse and dropped the framerate even more. So there must be some meta data or reference to them....
Sorry for the long post but I am just frustrated and confused. My Early Access game that I have been working on for four years is doing great and this is killing the forward progress on it during the most important time.
Anybody seen this before? I could really use a little guidance. Im lost.
Thanks very much.
Kevin