I need help... PLEASE!

im working on a td game where you can summon new units by “spinning for them” aka a random character picker this is the code i have made so far


i have 23 units for the generator to pick from but instead of picking one it just places all of them on top of each other
i have each unit corresponding to a number going from the highest strength to the lowest 23-1
and i need help making it work.

1 Like

A random number generator will output a random number to all of it’s outputs. This means you are sending a random number to every link you have connected to it (Therefore spawning every tower).

If you want this setup to work you should replace all of the number behaviors with filter behaviors

3 Likes

I tried it and it doesn’t work

It’s hard to see what you’re doing when it’s that zoomed out, but it looks like you’re connecting it to the “value” input on the filter. That changes the value of the filter to check for a new number. You want to put it in the “in” input to check the random number.

Here is an example of what some of it should look like (Be sure to set the filters to “equals to”, I forgot to do that):

1 Like

At this point though, it would be easier to change your method and use a router behavior like this:
image

6 Likes

I was going to say this, please use a router for this.

2 Likes

routers have a random option too so you dont even need the random behaviour

3 Likes

True, I was just being hesitant with introducing too much new stuff at once. If filters are proving a hurdle, it’s best to make sure you’re understanding the basics

1 Like