playMaker

Author Topic: Array Length  (Read 1181 times)

FrankDePaul

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
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: 6302
    • View Profile
    • 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?
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

Baal7734

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
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: 6302
    • View Profile
    • 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
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!