playMaker

Author Topic: Slowdown when instantiating an FSM  (Read 2104 times)

AyaTou

  • Playmaker Newbie
  • *
  • Posts: 3
Slowdown when instantiating an FSM
« on: March 07, 2013, 03:41:42 AM »
I'm getting performance hiccups whenever I instantiate an FSM.

I have a GameObject on the scene and it has an FSM component.
Then, when I use the Instantiate() method to create duplicates of that GameObject, I get noticeable performance hiccups, especially in an Android platform.
Of course the hiccup doesn't happen when I don't have the FSM in the GameObject.

Do you have any idea about what is causing this issue and how can I fix it?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Slowdown when instantiating an FSM
« Reply #1 on: March 07, 2013, 09:59:05 AM »
First, make sure that you're using 1.5.4 since it fixes some slowdown introduced in 1.5. We're looking into ways to reduce FSM load time further...

In general it's always a good idea to make all the GameObjects you need at the beginning of the level, and then re-use them as needed (Show/Hide instead of Create/Destroy). Search for Object Pooling on the forums. This eliminates hitches from instanciating, and garbage collection.