playMaker

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

rondmc

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
On Trigger working in Editor but not Build[SOLVED]
« on: June 05, 2018, 01: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, 01:34:36 AM by jeanfabre »

t4d

  • Playmaker Newbie
  • *
  • Posts: 49
    • View Profile
Re: On Trigger working in Editor but not Build
« Reply #1 on: June 05, 2018, 11:22:36 PM »
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: 17
    • View Profile
Re: On Trigger working in Editor but not Build
« Reply #2 on: June 06, 2018, 03: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 06, 2018, 10:23:29 PM by rondmc »

rondmc

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: On Trigger working in Editor but not Build
« Reply #3 on: June 07, 2018, 04: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
    • View Profile
Re: On Trigger working in Editor but not Build
« Reply #4 on: June 19, 2018, 12: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: 1
    • View Profile
Re: On Trigger working in Editor but not Build
« Reply #5 on: April 17, 2019, 10:03:19 PM »
Thank you. I solved the same problem.
-Unity 5.6.2p4
-PlayMaker 1.9.0