[Unity]Make objects rise like balloons


I would like to show you how to create the balloon movement used in the target game.

First, prepare an object with a balloon-like model as a child element.
Add Rigidbody to the object and add a script. In this case, I used “Target” as the name of the original script.
Next, prefabricate the object. Optional

In the contents of the Target script, the object is rising up in FixedUpdate and swinging left and right in Mathf.PingPong.

Below is a sample actually built on WebGL.
As in the target game, balloons appear randomly from 9 locations.

– Sample –

There may be other good methods, but please refer to them if you like. m