F
F
FC182020-12-20 15:01:35
Unity
FC18, 2020-12-20 15:01:35

Movement of many objects according to one principle?

There are scripts:

public class Movement: MonoBehaviour
{
//calculates the destination according to the general algorithm, changes it through a getter
}
public class Rooms: MonoBehaviour
{
//also calculates the destination
}

public class Persona: Movement
{
private Vector2 destination;
// attached to people-objects that change their positions based on destination
}

I can't figure out how to make destination separate for each person - they all take the same common value and go to the same point in a friendly swarm .(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2020-12-20
@freeExec

If everyone multiplies 2 by 2, everyone will get 4. I don’t see any problem here, everything is logical.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question