playMaker

Author Topic: Playmaker causing Lag (especially on Create Object)  (Read 1359 times)

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Playmaker causing Lag (especially on Create Object)
« on: February 04, 2018, 04:20:20 AM »
Even doing small things seems to lead to quite a bit of slowdown in the Editor and even when the game is built. I decided to test it out by setting up a few GameObject spawners.

There's 5 of them in the Scene. They each have a child with a white square sprite and have this FSM.

https://i.imgur.com/CiC9t2k.png

The first state gets the owner and sets a random wait time between 0 and 3 seconds. The second state creates a Game Object on the owner's position. The third just random waits again between 1 and 2 seconds.

The Object that it spawns has a red box sprite and 2 FSMs. The first sets it's velocity2D, the second just waits 5 seconds before destroying the object.

This is what the scene looks like when running.

https://i.imgur.com/1xYv8CR.png

And this is the result from the Profiler.

https://i.imgur.com/CgFhLuA.png

I'm getting ~3 frames. My computer is solid as well. I've heard that Instantiating and Destroying a lot of objects can get strenuous, but I don't think only ~15ish objects at once bringing the fps down to a crawl is normal. Also don't get why there are so many calls going on.

Plz help :(
« Last Edit: February 04, 2018, 04:25:12 AM by MikeTelly »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Playmaker causing Lag (especially on Create Object)
« Reply #1 on: February 08, 2018, 04:33:22 AM »
Hi,

 from the profiler, your issue comes from FixedUpdate, which leads me to think you have an issue with your physics setup.

 PlayMaker executes actions, which in turns control Unity, If one of these actions does something that affects performances, then you need to solve this, and PlayMaker has nothing to do with it per say. Does that make sense?

 If you can't solve this, Send me a package with a scene which repro your issue, and I'll have a look.

 Bye,

 Jean