playMaker

Author Topic: array get float help  (Read 675 times)

andyandyandy

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
array get float help
« on: February 01, 2021, 10:54:23 PM »
Im new to arrays. So what I'm trying to do is get all child of a gameobject and store it in a array (as gameobjects): Completed

Now I'm having trouble as I want to get a certain float in all the child game objects. Is there anyway to do that or is there a simpler way to get a float from all gameobject listed in a array?

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: array get float help
« Reply #1 on: February 01, 2021, 11:20:27 PM »
if you want to learn about array, i highly recommend you to invest your time on this
https://hutonggames.fogbugz.com/?W715

it is called arraymaker and it is way better than the built in.

Now, to answer your question.

since you already store all the game object in say "arrayObject", the next step is to retrieve it one by one. so it goes like this

1. array get object and enter the index
2. Use "get fsm float" command, and enter the object that you retrieve and name of the variable that you want to retrieve
3. store it in a temp variable "tempFloat" and add it to the new array "arrayFloat"
4. add the index +1 and repeat process no 1

your arrayFloat should filled with all the float that you retrieved

good luck

andyandyandy

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
Re: array get float help
« Reply #2 on: February 02, 2021, 04:24:35 PM »
if you want to learn about array, i highly recommend you to invest your time on this
https://hutonggames.fogbugz.com/?W715

it is called arraymaker and it is way better than the built in.

Now, to answer your question.

since you already store all the game object in say "arrayObject", the next step is to retrieve it one by one. so it goes like this

1. array get object and enter the index
2. Use "get fsm float" command, and enter the object that you retrieve and name of the variable that you want to retrieve
3. store it in a temp variable "tempFloat" and add it to the new array "arrayFloat"
4. add the index +1 and repeat process no 1

your arrayFloat should filled with all the float that you retrieved

good luck

thank you so much, I followed your steps and it works exactly like you said!