playMaker

Author Topic: Array Length  (Read 1768 times)

FrankDePaul

  • Playmaker Newbie
  • *
  • Posts: 25
Array Length
« on: February 10, 2018, 06:02:16 PM »
I am using Array Length to get the length of an array.  For the array I have a variable, and am trying to store the length in an Int variable.

When I run the game and pause I can look at the Array Length action and under the Array variable I see 3 items that were added.

The Int variable stays at 0.

I have Every Frame checked and the int value never changes.

Am I doing this incorrectly?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Array Length
« Reply #1 on: February 10, 2018, 07:26:58 PM »
Hi,
I just tested and it seems to work on my end.
i can see that your action is faded out, which means that it is not active, so it is not looking for the length anymore.
It will only give the result from an action when the state/action is active.

Maybe you have a different action changing the (Length) variable value on a different state?

Baal7734

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Array Length
« Reply #2 on: April 11, 2018, 03:57:52 AM »
I'm having the same issue. The array is greyed out in this picture because it was taken while the script was playing. The object is active.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Array Length
« Reply #3 on: April 11, 2018, 05:54:31 AM »
Hi.
@Baal7734

i can see that every frame is not checked so the action will only check once and finish.
Maybe that's the issue in your case.

if a state is active and every frame is checked the action should not grey out.

Greetings,
Dino