Playmaker Forum
Bug Reporting => PlayMaker Bug Reporting => Topic started by: Rfdshir on November 15, 2020, 07:18:43 AM
-
Unity 2017.4.40
Playmaker 1.9.0 p4
When Game Object in the Trigger2d Event changes in runtime, the action continue to detect collisions for the previous Game Object, not for the new one.
I've add "GetProxyComponent(); " in the OnEnter, and now it's work fine (don't know if it's a correct solution)
-
Hi.
Maybe something in your logic
-
I've try it on simplest example (screen in attachement). When the OnTriggerEnter2D Event happen and Obj var changes to Game Object (2) in State2, the Trigger2d Event continues to recieve collisions from the Game Object (1). Idk, maybe I'm doing something wrong, or this is one of the Unity bug. :-\
But when I've add one line of code - same FSM begun to work fine. I'm not a programmer though.
-
Hi.
This will get the proxy component every time you enter the action.
The GetProxyComponent in this part will not trigger as it already has set one, meaning its not null.
if (cachedProxy == null)
GetProxyComponent();
Its not advisable to change them during runtime.
but if you really need to, then try this instead :
if (cachedProxy.gameObject != gameObject.GameObject.Value)
GetProxyComponent();
instead of the part that you added.
also put it above the update callback
-
Thank you very much!