Make a 2D Space Shooter Game: Asteroid Ambush in Unity (Tutorial)
For quick art changes that need to be swapped out quickly across platforms for updates, echo3D makes it easy to do this by simply using an API key. Assets are stored on the echo3D cloud and called at runtime.
In this tutorial, you will import asteroids and planets as the obstacles in Asteroid Ambush!
Click this link https://go.echo3d.co/c3nA or scan this QR code to see something out of this world 🪐.
Don’t have an echo3D account? Register for FREE at echo3D.
Clone this repo, see the full README
Add the assets to the echo3D console from the Unity ‘Models’ folder
Uncheck the Security box in your console
In Unity, open the Game scene
Drag the echo3D script onto the Planet 1–3 and Asteroid 1–3 objects in the Hierarchy
Add the API key and entry ID for each object in the Inspector
In the Hierarchy, make sure to the boxes are unchecked for the Sprite Renderer for Planet 1–3 and Asteroid 1–3
Press Play in Unity to see where the 3 assets show up in the scene so you can modify the metadata in the console
Adjust the metadata in the echo3D console as follows so the assets appear within the colliders. These may work for you: Asteroid 1: scale: .02, yAngle: 180, xAngle: 90, x: -1.7, y: 3.6 Asteroid 2: scale: .02, yAngle: 180, xAngle: 90, x: 2, y: 2 Asteroid 3: scale: .02, yAngle: 180, xAngle: 90, x: .9, y: -1.2 Planet 1: scale: .02, yAngle: 180, xAngle: 90, y:3 Planet 2: scale: .02, yAngle: 180, xAngle: 90, y: -3.5, x: 1.5 Planet 3: scale: .02, yAngle: 180, xAngle: 90, y: -3.5, x: -1.5
Press Play in Unity and click in the Game window to change the rocket’s direction. Hit the 3 asteroids to save the galaxy! If you hit the planets, the game will restart. Control rocket with your mouse click.
Switch Out Assets
Find new asset in the echo3D console (Or you can upload your own or choose from our library)
Get the API key and entries ID
Swap them out on the echo3D script in the Unity Hierarchy and see your assets change when you run in Play mode
Refer to our documentation to learn more about how to use Unity and echo3D.
Feel free to reach out at support@echo3D.coor join our support channel on Slack.
Space assets: jcomp / freepik
For more easy tutorials, check these out:
echo3D (www.echo3D.co; Techstars 19’) is a cloud platform for 3D/AR/VR that provides tools and network infrastructure to help developers & companies quickly build and deploy 3D apps, games, and content.