playMaker

Author Topic: Spawned Objects do not receive Events  (Read 1498 times)

DanielWicht

  • Playmaker Newbie
  • *
  • Posts: 7
    • my game
Spawned Objects do not receive Events
« on: June 06, 2024, 09:10:33 AM »
In every Playmaker project I stumble upon the same problem at a certain point: Gameobjects that are instantiated from a prefab during runtime do not receive events such as OnCollisionEnter.

  • This only happens in the build (Windows, in my case) - not in the editor.
  • This does not happen if the gameobject is not instantiated but already exists in the scene, so this is not a physics, rigidbody, anything problem.
  • This does not happen if I receive the event (OnCollisionEnter) using a normal script, so this is not a Unity, but a Playmaker issue (which might be based on a Unity issue ^^)

i tried sending events from script to playmaker essentially forwarding the collision. these events are also not received by the instantiated object. i did SendEvent(FsmEventName)" and PlayMakerUtils.SendEventToGameObject(targetFSM, this.gameObject, FsmEventName)" - both are ignored.

I wonder if my setup is weird. I am creating level prefabs which i spawn when i need them. Inside these level prefabs there are gameobject that the player can collide with. And excactly that collision is not received.

Thanks! Daniel

Unity 2022.3, PM 1.9.8 - but i had the same issue with earlier versions

DanielWicht

  • Playmaker Newbie
  • *
  • Posts: 7
    • my game
Re: Spawned Objects do not receive Events
« Reply #1 on: June 06, 2024, 09:23:34 AM »
can someone tell me what these scripts in my attachment are? they sometimes are added to my objects with CollisionEvents. but not always - rather rarely. I get the feeling this is related to my problem
« Last Edit: June 07, 2024, 08:32:51 AM by DanielWicht »