How do multiple objects in sequence from a queue?
I currently have 2 different approaches that i have been taking to solve this problem.
i have a Queue of IEnumerators that gets filled with a moveQueen function that takes in a transform.position and a vector3. I later in the code dequeue these items and start a coroutine with them to move the corresponding transform to the vector3 is was paired with. At the moment it is just moving every transform at the exact same time to the last position it has. is it possible to make a coroutine move an object in sequence as i dequeue them?
made another Queue of just vector3 which holds all the positions that every transform will move to. I set a flag in my code that indicates that the queue is finished being filled and in the update function it flips a flag that will start dequeueing the vector3s.
in both situations i am attempting to use lerp to move from 1 position to another. and in both situations the objects end up moving to the last position it would have ended in instead of moving to a position stoping , the next object moving then stopping and so on.
if anyone has any suggestions they would be greatly appreciated. and i can post both methods ive tried if that helps. thanks guys!
Your answer
Follow this Question
Related Questions
Animation out of time with custom clock 0 Answers
Control lerps with if-statemnts in Update or with Coroutines? 1 Answer
Lerp with Coroutine doesn't behave as expected 0 Answers
Crouch Lerp Coroutine Problems 0 Answers
Queue a Coroutine with a List? 1 Answer