I have a code that follows this logic:
function Update() {
if (event happens) {
for loop through GameObjects array {
Lerp the position of 5 to 10 game objects
}
}
}
The problem with that is that the Lerp only happens for one frame, because the triggering event happens only for one frame.
I saw on another site that I could make a Lerp function that would be called while (_isLerping == true), but the problem is I can’t make references to the GameObjects that are within Update() and the if statement, even if I create a variable and assign the object to it.
How am I supposed to use Lerp on events that happen only for one frame?