PlayMaker Help & Tips > PlayMaker Help

On Trigger working in Editor but not Build[SOLVED]

(1/2) > >>

rondmc:
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.

t4d:
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:
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.

rondmc:
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:

--- Quote from: rondmc 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.

--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version