playMaker

Author Topic: Find game object + array list create issues  (Read 6555 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Find game object + array list create issues
« on: July 30, 2015, 03:20:46 AM »
So for array practice, I thought I'd experiment Array list create in order to test interactivity with other objects.




https://db.tt/VGgJTOis

https://db.tt/iYd7WzDH

https://db.tt/9ZN676iH

Regardless if objects are parent or not, when in runtime it's like those actions for the start state don't act responsive as well as array list add.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Find game object + array list create issues
« Reply #1 on: July 30, 2015, 07:19:58 AM »
Hi,

 When you create a array at runtime, wait one frame to start using it, it helps.

 Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Find game object + array list create issues
« Reply #2 on: July 30, 2015, 02:50:51 PM »
Hi,

 When you create a array at runtime, wait one frame to start using it, it helps.

 Bye,

 Jean

So, next frame event in a separate state before transitioning into the state with Array List Add?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Find game object + array list create issues
« Reply #3 on: July 30, 2015, 03:07:00 PM »
Hi,

 Yep, just create your array, then have a next frame event, then you can do whatever with it. I never understood why to be honest... cause all code should be synchronized... so I don't have a real explanation of that, sometimes it work, sometimes it doesn't, it depends... so have a next frame and it will work always.


Bye

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Find game object + array list create issues
« Reply #4 on: July 30, 2015, 05:43:11 PM »
Hi,

 Yep, just create your array, then have a next frame event, then you can do whatever with it. I never understood why to be honest... cause all code should be synchronized... so I don't have a real explanation of that, sometimes it work, sometimes it doesn't, it depends... so have a next frame and it will work always.


Bye

 Jean

Odd, well unfortunately I get a error.

Code: [Select]
The fsmVar value <UnityEngine.GameObject> doesn't match the value
Don't understand why it does this, even with array list add after Find game object.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Find game object + array list create issues
« Reply #5 on: July 31, 2015, 04:46:09 AM »
Hi,

 that's already another issue. Can you get the latest version, it will give you a lot more infos on that error, and you'll be able to see exactly what's wrong in the action, it's likely that the action was not setup properly.

 Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Find game object + array list create issues
« Reply #6 on: July 31, 2015, 06:54:16 AM »
Even with this set up?

https://db.tt/Ix7AN6xs

https://db.tt/jLWgMnpX

https://db.tt/WH6tAryD

Now it doesn't display those errors.

Still, can't seem to make the parented cubes move.  Thought with this method it would be simple enough not to add a additional fsm, let alone add a fsm to each cube.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Find game object + array list create issues
« Reply #7 on: July 31, 2015, 07:31:01 AM »
Hi,

 I think you are getting very confused.

 if you add "5" to an array, this is just an int, you need to ave in the array the GameObjects for each platforms.

 then as you get a random index in that array, arrayList Get will return you the platform for that index.

 try to remove all your disabled actions, don't create the array at runtime, and drag your platforms in the array during runtime, and see how it behaves to take a hard coded index, maybe 3, then work your way into making it then random.

 Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Find game object + array list create issues
« Reply #8 on: July 31, 2015, 03:50:03 PM »
Hi,

 I think you are getting very confused.

 if you add "5" to an array, this is just an int, you need to ave in the array the GameObjects for each platforms.

 then as you get a random index in that array, arrayList Get will return you the platform for that index.

 try to remove all your disabled actions, don't create the array at runtime, and drag your platforms in the array during runtime, and see how it behaves to take a hard coded index, maybe 3, then work your way into making it then random.

Therefore, delete managers Array List Proxy, add Array List Create so that list instead appears during runtime, prefill count to 6, then drag all objects into the PreFilled Data area of the list when in runtime?

And then after that have a state dealing with "ArrayList Get" before the FSM finishes? Or after that, have it somehow make it continue moving the children?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Find game object + array list create issues
« Reply #9 on: August 03, 2015, 03:16:23 PM »
Hi,

 no simply drag at during editing, have a prefill of 6 items, and drag each platform in order ( NOT when playing),

then you have at runtime your list of platforms, and you simply use it without modify it, use ArrayList Get with a index between 0 and 5.

Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Find game object + array list create issues
« Reply #10 on: August 03, 2015, 03:29:44 PM »
then you have at runtime your list of platforms, and you simply use it without modify it, use ArrayList Get with a index between 0 and 5.

To keep things more simplified, replacing random list action with ArrayList Get, the result type would also be set to game objects? As well as the local variable?
« Last Edit: August 03, 2015, 03:32:41 PM by coffeeANDsoda »