playMaker

Author Topic: Collision Enter working in Editor but not in Build [SOLVED]  (Read 2525 times)

thirdeyenz

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Collision Enter working in Editor but not in Build [SOLVED]
« on: October 25, 2016, 01:31:05 AM »
I've finally figured out the fix for something that's been a problem for my game for months and I thought I'd share it.

TL;DR Use a Collision Event Action and hit the Use Variable button to change it to None to avoid having to choose a tag.

FSMs that use the COLLISION ENTER event were not firing in the builds but working fine in the Editor. I wasn't using the Collision Event action because I thought you had to choose a Tag (that's the whole reason it exists pretty much) and I wanted objects with different tags to fire off a collision.

I narrowed it down to prefabs that were being instantiated being the problem. When I tested using the Collision Event action I discovered that clicking on the Use Variable button next to the Tag name changed it to None. So I now had a collision action that wasn't tag dependant. And now my collisions work in the build.

Hopefull this will help someone out there with a similar problem. Why Collision Enter events aren't working in my builds is a question I can't answer but they certainly used to in older versions of Unity and Playmaker.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #1 on: November 04, 2016, 01:16:23 AM »
Hi,

 I think it's because there is a new issue with setting a variable to none that injects the olds values instead of the default ( null, 0 or false depending on the variable type).

 Bye,

 Jean

Aaddiction

  • Junior Playmaker
  • **
  • Posts: 87
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #2 on: November 23, 2016, 06:56:05 AM »
Same problem and honestly I didn't get the solution. From Jean's post I understand that this a bug and should be fixed, right?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #3 on: November 23, 2016, 11:14:12 AM »
Hi,

 Not really :) the bug would be replicable on every platform including the editor. I haven't personally experienced or reproduce a difference in behaviour for this.

It depends if your issue if because of the tab or if it's because of a known issue that hopefully will be soon addressed that makes a property set to none use the previous values.

 So watch out for what exactly you change in your actions until it works. I'll be interested to know what went on.

Bye,

 Jean

Aaddiction

  • Junior Playmaker
  • **
  • Posts: 87
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #4 on: November 23, 2016, 11:46:20 AM »
Hi,

May be it's something different, but here's my issue. The system event COLLISION ENTER does not work on Windows build, built with Unity 5.3.5 with latest PM version. Screen attached. Don't know about what none var are you guys talking about. :) It's the system event that works fine in the editor and not in the build.

Edit: and what thirdeyenz is saying above is to use Collision Event instead of COLLISION ENTER, because COLLISION ENTER does not seem to work.

Quote
Why Collision Enter events aren't working in my builds is a question I can't answer but they certainly used to in older versions of Unity and Playmaker.

Same here.

Thanks. 
« Last Edit: November 23, 2016, 11:51:16 AM by Aaddiction »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #5 on: November 23, 2016, 11:35:03 PM »
Hi,

Ok, can you try with this scene on a totally fresh project? the cube turns red when colliding using this COLLISION ENTER system event.

If that works, then the problem is elsewhere, else, we'll take it from there and further refine what could possibly go wrong.

Bye,

 Jean



Aaddiction

  • Junior Playmaker
  • **
  • Posts: 87
    • View Profile
Re: Collision Enter working in Editor but not in Build [SOLVED]
« Reply #6 on: November 26, 2016, 07:19:37 AM »
Hi,

It seems to work in the attached scene. Maybe when the project/FSMs get bigger and more complicated I do something that causes this behavior, but as you said I will try to find out what is it when debugging.

Thank you.