0
Answered

Why count total element of a list always result 1 item only ?

agan 2 years ago updated 2 years ago 2

Hi,

i try to create a list which consist 35 elements, it using LOOP-FOR.

To verify it has 35 elements, after the EXIT LOOP , i try to count total element, but it tell only contain ONE item :

The Result :



The Diagram :


The Graph Variable :


Any Idea ? Thanks in advance...

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED

this solve basic technique to create simple list with more than 10 items...

Satisfaction mark by agan 2 years ago
+1
Answered

Hi Agan,

Because you're creating a new list at every iteration in the for loop! So right now you have 35 lists with 1 items in each of them.

Try creating your list before the for loop, and using Get Variable (List1) to pass to Add List Item.

+1

Hi many thanks..

i should be familiarize with variable...

so it should be like this :

i post here as reference to anyone facing same problem...