Evaldas Paulauskas

iOS developer professionally, hobbyist gamedev

What I learned making pong

04 Sep 2020 » unity

Introduction

Last weekend I’ve met up with one of my classmates who has zero experience and confidence in game development to make a simple 3d pong game in unity C# over a couple of hours

Problem

Due to it being a quick prototype, I’ve used Unity interface for most of the tasks, like creating the level, placing prefabs/ball on the scene. Which even for such a simple prototype immediately caused problems when trying to create reset systems/level loading

(we wanted to make different levels, for it to be more advanced version of pong)

Solution / Ideas

Even when prototyping, create systems first. It will make iterating/changing things around much easier, and smooth as prototyping phase goes on.

And what do I mean by that? Any Concrete tips?

  • In unity scene, only place empty gameobjects as spawn points ( or perhaps not even that, and use coordinate system to spawn spawners )
  • write a general level manager script, to manage instantiating players/level etc. At all of the specific spawn points.
  • Never place any prefabs onto the scene!!! Always instantiate through code
  • Anything that can be done through code, should be done through code, even if its “faster” through unity UI.

Another big advantage of this, is git/version control of your project. We ran into some issues with unity scenes and git. Changes that we made had conflicts with another branch. While if we were doing everything strictly through code, not only would it make the project clearer, and easier to read for someone who doesn’t use unity often, but also make maintaining the project much cleaner and easier.

pong screenshot

Sample screenshot from the 3d pong using physics prototype