O
O
OblivionGM2021-08-30 13:43:54
Unity
OblivionGM, 2021-08-30 13:43:54

How to make two objects randomly move across the screen?

How to make two objects on the screen (let them be fish) swim across the screen regardless of each other, in a chaotic direction (like aquarium fish)?612cb666df696950982761.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2021-08-30
@Griboks

If chaotic, then each frame set random coordinates.
If smoothly, then each frame you add or subtract a random number from the jerk vector (this is r'''), and then integrate 3 times. The larger the derivative you change, the smoother the trajectory.
It can also move objects through randomly parameterized bezier curves.
And many more ways.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question