P
P
programmist_derevo2019-12-25 17:31:15
C++ / C#
programmist_derevo, 2019-12-25 17:31:15

How to implement such a mechanism in Unity?

I don't know how to describe it programmatically. Help.
The task is that there are 10 GameObjects. There is a script that constantly affects them with monotonous work (let's say it increases them in size every frame). Goal: increase from 1 meter to 10.
GameObjects start at different sizes, some will reach 10 meters faster, some later. Who has reached - is removed from the sheet, i.e. the script no longer affects it. There is still a random number of GameObjects in stock, when someone left the first list (there were 9 of them), someone from this random is taken and added to that list. And now it is also growing in size.
Here is such a task. The problem is implementing lists from GameObjects, finding specific GameObjects in them, managing them, and deleting them. Can't do it. Show some mechanism-example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-12-25
@programmist_derevo

the description is really bad)
what's the problem with making the list of GameObjects
loop through it - you should also see "for" in the eyes.
check the size - take transform.scale and check.
deleting and adding an element of the list is also as easy as shelling pears (just don’t forget that the index in the list will shift and adjust)
You would at least start implementing -> faced some kind of problem -> write here with "for some reason the remote is not replaced object to a new one from the spare list" or with a similar question and an example of your code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question