Unity’s Floating Spaceships: Quick and Effortless Creation for Stunning Visuals
![Unity’s Floating Spaceships: Quick and Effortless Creation for Stunning Visuals](/blog/assets/images/unity-spaceship-1.gif)
One of the easiest ways of making a game object float in Unity is to use Sine function.
Step 1: Download any free spaceship obj from Turbosquid.
Step 2: Import it in Unity and add game component ‘Rigidbody’ and disable gravity.
Step 3: Add a script move on the Game Object and write down the given code snippet.
Step 4: Add Rigid body in inspector to game object and put these respective values:
Speed= 1f-2f
Amplitude= .1f-1.0f
or you can do it accordingly.
You have your floating spaceship in unity.