I am trying to do a shuffle functionality so I can change the order of multiple GameObjects
.
I have multiple "letters" (GameObjects
) in a circle and when I click "Shuffle" I just need to reorder their position but showing the letter moving to it's new position.
I tried: Vector3.Lerp(startPosition, targetPosition, Time.time/2)
or
Vector3.MoveTowards(startPosition, targetPosition, Time.time/2)
but it doesn't move correctly.
I manage to do the movement using this:
Vector3 tempPosition = object1.transform.position;
object1.transform.position = object2.transform.position;
object2.transform.position = tempPosition;
but I can only move 2 GameObjects
without showing any movement.