playMaker

Author Topic: Problem with Array Get Next looping  (Read 416 times)

Neikke

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Problem with Array Get Next looping
« on: July 19, 2019, 11:35:51 AM »
Problem with Array Get Next looping

been cracking my head for a few days with this already. Here's the deal. I have two Boxes standing very close to each other. With each collision I'm placing them to Array, and with each loop event, storing them in CurrentCollider gameobject Variable in Array Get Next action. Each of these Boxes have FSM with Spawn Random Powerup Global Event trigger which does the following:

1) Spawning PowerUp prefab taking it from the PowerUp Pool
2) Parenting it to Player Character
3) Playing some simple scale bounce animation on PowerUp
4) Quickly moving PowerUp towards Player Character
5) UNparenting PowerUp prefab from Player character
6) Deactivating PowerUp Prefab and putting it back to the Pool

The problem is when I'm calling this SpawnRandomPowerup on the first Box_01, doing a loop in Array Get Next and calling SpawnRandomPowerup on the newly added and stored Box_02, all activity on Box_01 is being freezed on Step 3, resulting in Powerup just floating forever above my Player Character and what's even worse - staying parented to it not being able to return to a Pool.

How should I set everything up so that both Boxes play their respective FSMs independently? Please help!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6019
    • View Profile
    • jinxtergames
Re: Problem with Array Get Next looping
« Reply #1 on: July 19, 2019, 11:47:55 AM »
Hi.

Have you tried placing some breakpoint to the prefabs.
This could narrow down what is going wrong.

maybe you can show some fsm setups as it is hard to say what is going wrong