playMaker

Author Topic: global variable updates too slow  (Read 2174 times)

bkups2003

  • Playmaker Newbie
  • *
  • Posts: 49
global variable updates too slow
« on: July 07, 2013, 11:39:34 PM »
Hello,

I have a global variable vector 3 that is defined and changed in one fsm to instantiate objects in a grid. I use reference.load to bring the objects in and each object has a fan that takes that global variable and sets its position to that vector 3. The problem is when I start the game, I get a cluster of all instantiated objects at one position. Even though the vector3 variable changes before each new object is created.

While debugging, I added a wait of 0.1 seconds in my main fsm and suddenly each object is created and moved to the right location. Without the wait, they all go to the same location.

I would rather not increase the load time on purpose. Does anyone know what I can do to fix this without adding a wait?

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: global variable updates too slow
« Reply #1 on: July 08, 2013, 12:11:03 PM »
Can you just use use Next Frame Event to give it time to set up? I don't think you would be able to notice that delay.

bkups2003

  • Playmaker Newbie
  • *
  • Posts: 49
Re: global variable updates too slow
« Reply #2 on: July 08, 2013, 09:18:33 PM »
Thanks for the advice. I gave it a try and it works just like the wait does. Without the wait, everything is created in less than half a second. With the wait, it goes up to around 4-5 seconds where up can watch each piece being placed. Next frame event is the same for some reason. From a half second wait to a 4-5 second wait where u can see each piece being placed.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: global variable updates too slow
« Reply #3 on: July 09, 2013, 02:52:44 AM »
Hi,

 Turn the problem around, make your instantiated object seek its position, instead of expecting it to be available, and also, make it invisible or something so that you don't see any flicker in positioning.

Yes?

bye,

 Jean