playMaker

Author Topic: On Trigger working in Editor but not Build[SOLVED]  (Read 4487 times)

rondmc

  • Playmaker Newbie
  • *
  • Posts: 24
On Trigger working in Editor but not Build[SOLVED]
« on: June 05, 2018, 04:18:47 PM »
I tried reading the other topics related to this issue but none seem to be helping me figure this out.

Unity - 2017.3.1f1
PlayMaker 1.8.9

  • My player object has a child object both with the same layer name but different tags. The On Trigger actions seem to only ignore this game object.
  • The child object does not have a Rigidbody 2D, but the parent does.
  • Everything works in the editor, but after I build the game the triggers that work/don't work seem to be random. So on one build, the player interacting with enemies works but may not trigger traps. On the other build, the player may trigger traps but may not collect items.
  • All triggers working/breaking are dependent on the child object of the player and sometimes on another child of the player that's created at runtime from a prefab.
  • Everything else in the game seems to run fine. Collision, AI, addons, menus, etc. It's just this one thing.

I think that's everything. I'm not sure if this is a PlayMaker issue, or I'm doing something wrong with Unity, but the issues occur due to PlayMaker On Trigger actions being used. Development builds don't throw any errors either. I'm pulling my hair out over this, mostly because the issue is semi-random.
« Last Edit: April 18, 2019, 04:34:36 AM by jeanfabre »

t4d

  • Junior Playmaker
  • **
  • Posts: 70
Re: On Trigger working in Editor but not Build
« Reply #1 on: June 06, 2018, 02:22:36 AM »
Make sure your triggers are not touching anything or overlapping anything.

any overlapping trigger will work in the editor but at runtime won't work.



rondmc

  • Playmaker Newbie
  • *
  • Posts: 24
Re: On Trigger working in Editor but not Build
« Reply #2 on: June 06, 2018, 06:15:43 PM »
A friend of mine who's active in helping others in the Unity Discord says it shouldn't matter and other triggers go off on the same object no problem.

I tried updating to 2017.4.4f1 but that didn't help. I tried adding more debugs to a dev build and it's definitely the triggers not firing, not the FSMs not starting.

I'm going to try and to a get tag debug and see if maybe it's the tags messing up on build or if it's the colliders.

EDIT: So it's not the that the tags are being lost or anything. It's just that the triggers aren't hitting.
« Last Edit: June 07, 2018, 01:23:29 AM by rondmc »

rondmc

  • Playmaker Newbie
  • *
  • Posts: 24
Re: On Trigger working in Editor but not Build
« Reply #3 on: June 07, 2018, 07:57:16 PM »
Okay, I thiiiiink I figured it out. I've made a build of my game 5 times with consistent success so knock on wood.

So if I understand it correctly, a FSM with an On Enter action automatically creates a On Enter Trigger component on the object, then is supposed to target the FSM in question that has it. For some reason, the objects that were having issue, did not link back to the FSM. The target FSM list was empty. After linking it, I've had no problems with the triggers not firing.

For good measure I updated the prefabs with what I assume were legacy scripts to make old On Enter actions work with updated versions of PlayMaker. I'm not sure what they were tbh. They were empty child objects that only appeared in the folder and not in the hierarchy when placed in the scene. Placing them in the scene and then applying the prefab got rid of them though with no issues after.

Don't know why it only broke during a build since it looked like it would be needed while playing in the editor as well though. That part still confuses me.

TwisterK

  • Playmaker Newbie
  • *
  • Posts: 2
Re: On Trigger working in Editor but not Build
« Reply #4 on: June 19, 2018, 03:38:51 AM »
Okay, I thiiiiink I figured it out. I've made a build of my game 5 times with consistent success so knock on wood.

So if I understand it correctly, a FSM with an On Enter action automatically creates a On Enter Trigger component on the object, then is supposed to target the FSM in question that has it. For some reason, the objects that were having issue, did not link back to the FSM. The target FSM list was empty. After linking it, I've had no problems with the triggers not firing.

For good measure I updated the prefabs with what I assume were legacy scripts to make old On Enter actions work with updated versions of PlayMaker. I'm not sure what they were tbh. They were empty child objects that only appeared in the folder and not in the hierarchy when placed in the scene. Placing them in the scene and then applying the prefab got rid of them though with no issues after.

Don't know why it only broke during a build since it looked like it would be needed while playing in the editor as well though. That part still confuses me.

Thanks buddy, I've encounter exactly the same situation. Save me tons of hour to solve this.

doyobee

  • Playmaker Newbie
  • *
  • Posts: 4
Re: On Trigger working in Editor but not Build
« Reply #5 on: April 18, 2019, 01:03:19 AM »
Thank you. I solved the same problem.
-Unity 5.6.2p4
-PlayMaker 1.9.0

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: On Trigger working in Editor but not Build[SOLVED]
« Reply #6 on: January 14, 2021, 02:05:44 PM »
I have same issue with COLLISION ENTER. How do I figure out if those files are linked?

When Playmode is off. It looks like this


When Playmode is on, it does link it.
https://i.gyazo.com/e5d04c5f6bdb780fafdc3ca3dc55fe11.png

In build it will not work, but If I make new build there's a chance that it will start working.


Update: I've noticed that in new version of Unity/Playmaker. I can link those scripts.


I wonder how can I do this in 1.8.4 version of playmaker. Or this is a bug?

« Last Edit: January 14, 2021, 03:07:32 PM by Gua »

Graham

  • Sr. Member
  • ****
  • Posts: 333
  • I Love Playmaker!
    • Portfolio
Re: On Trigger working in Editor but not Build
« Reply #7 on: March 19, 2024, 07:56:46 AM »
Okay, I thiiiiink I figured it out. I've made a build of my game 5 times with consistent success so knock on wood.

So if I understand it correctly, a FSM with an On Enter action automatically creates a On Enter Trigger component on the object, then is supposed to target the FSM in question that has it. For some reason, the objects that were having issue, did not link back to the FSM. The target FSM list was empty. After linking it, I've had no problems with the triggers not firing.

For good measure I updated the prefabs with what I assume were legacy scripts to make old On Enter actions work with updated versions of PlayMaker. I'm not sure what they were tbh. They were empty child objects that only appeared in the folder and not in the hierarchy when placed in the scene. Placing them in the scene and then applying the prefab got rid of them though with no issues after.

Don't know why it only broke during a build since it looked like it would be needed while playing in the editor as well though. That part still confuses me.

Thanks for sharing! This saved me a lot of time fixing the Android build after updating my project to a more recent Playmaker and Unity.
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!