Activating Variables in an array

Godot Version

4.3

Question

I have a bunch of points to pick up items and one delivery point.

How would I go about making it so these points will activate only a limited amount each time?

I have an array which holds values, then a function which takes the randi of the values and coordinates active objectives to them. Is there any other way to do this?

Everything is super hardcoded as i’m new, and i’m trying to get 3 values in an array of the points to make them active.

1 Like

Please explain a little better. What values does the array hold? What type? You can’t take a randi of a value, randi() is a standalone function. What do you mean with “takes the randi of the values and coordinates active objectives to them”?

Keep in mind, I do not have your project and have no idea what you’re trying to achieve. I’ll try to solve it when you explain a little better, but I can’t promise anything. Though, someone else might be able to, but they probably can’t right now.

I’m not sure if I understand the question correctly but you could try to set up a timer and connect the timeout signal to your code. In the newly created function iterate through an array with references to the points and activate/deactivate them.

Read up on signals and timers, they are incredibly useful!

1 Like