Make a Ping Pong Game in Unity (Tutorial)
Tags: tutorial, unity3d, 2d, gamedev
Published: 2022-07-21 23:08:09

Whether you’re hosting a ping pong championship or need to change out assets for projects deployed on multiple platforms, [echo3D](http://www.echo3d.co) makes it easy to do this by simply using an API key and updating in 1 place. Assets are stored on the [echo3D](http://www.echo3d.co) cloud and called at runtime so you can focus on other things. Like ping pong. Or trying out more open-source projects on our [Github](https://github.com/echo3Dco).

In this tutorial, you will play ping pong against another player (or the other side of your brain!)

![](https://miro.medium.com/max/1200/1*0Tv9KbwM0GJ0Ml9TETZxzQ.gif)

***

Click this link [**https://go.echo3d.co/b1Cm**](https://go.echo3d.co/b1Cm) or scan this QR code to see the ping pong championship logo in AR.

![](https://miro.medium.com/max/1400/1*iUBWFJ2J9_pUdghVajtoKg.png)

***

Register
========

Don’t have an echo3D account? Register for FREE at [echo3D](https://console.echo3d.co/#/auth/register).

Version
=======

[Unity 2020.3.25f1](https://unity3d.com/get-unity/download/archive)

Setup
=====

*   Clone this [repo](https://github.com/echo3Dco/Unity-echo3D-Demo-PingPongChallenge/), see the full README
*   [Import the Unity SDK](https://docs.echo3D.co/unity/installation)
*   [Add the assets](https://docs.echo3D.co/quickstart/add-a-3d-model) to the echo3D console from the Unity ‘Models’ folder
*   Uncheck the [Security](https://docs.echo3d.co/web-console/deliver-pages/security-page) box in your console
*   In Unity, open the _GameBoard_ scene
*   Drag the _echo3D_ script onto Background object in the Hierarchy
*   Add the API key and entry ID for each object in the Inspector

![](https://miro.medium.com/max/1400/1*0Z_JDVXFCJNPaE9CkL18BA.png)![](https://miro.medium.com/max/1040/1*-T_RzpcgJp9aAFEyxPYf-Q.png)

*   In the Hierarchy, make sure to the boxes are unchecked for the Sprite Renderer for Background
*   Adjust the [metadata](https://docs.echo3d.co/unity/transforming-content) of the Background in the echo3D console. These may work for you:
    BackgroundImage: scale: .1, zAngle: 180, height: 1180, xAngle: 90, width: 1920, x: .1

Run
===

*   Press _Play_ in Unity.
    Left player: w and s keys
    Right player: up and down keys

Switch Out Assets
=================

*   Find new asset in the echo3D console (You can upload your own or choose from our library)

![](https://miro.medium.com/max/1200/1*Ej527j0FyKH-Niin_tC4Ig.gif)

*   Get the API key and entries ID

![](https://miro.medium.com/max/1400/1*0Z_JDVXFCJNPaE9CkL18BA.png)

*   Swap them out on the echo3D script in the Unity Hierarchy and see your assets change when you run in Play mode

![](https://miro.medium.com/max/664/1*LIJnwnUcRyRt4Eskmb6QyQ.png)

Learn More
==========

Refer to our [documentation](https://docs.echo3D.co/unity/) to learn more about how to use Unity and echo3D.

Support
=======

Feel free to reach out at [support@echo3D.co](mailto:support@echo3D.co)or join our [support channel on Slack](https://go.echo3D.co/join).

Sources
=======

*   Ping pong background asset: [freepik](https://www.freepik.com/free-vector/detailed-table-tennis-logo_9891974.htm#query=ping%20pong%20logo&position=4&from_view=search)

Support
=======

Feel free to reach out at [support@echo3D.co](mailto:support@echo3D.co) or join our [support channel on Slack](https://go.echo3d.co/join). For additional troubleshooting, debug [here](https://docs.echo3d.co/unity/troubleshooting).

Screenshots
===========

![](https://miro.medium.com/max/1400/1*mmoT5-ODKCSZRUjAX3bBTQ.png)

More Tutorials
==============

For more easy tutorials, check these out:

*   [Build a 3D Balloon Pop game in Unity](https://medium.com/echo3d/build-a-balloon-pop-game-unity-free-eed9fe7d8be9)
*   [Get a Quarantine Dog in AR](https://medium.com/echo3d/get-a-quarantine-dog-in-ar-8383ea55376b)
*   [How to Create 3D Content and See It In AR](https://medium.com/echo3d/how-to-create-3d-content-and-see-it-in-ar-free-no-coding-required-369e5b4a4b3e)

***

>_**echo3D** ([www.echo3D.co](http://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._

![](https://miro.medium.com/max/1400/1*cNrRDT0JEpkcy-zG6KBNgw.png)