Prototype is defined as an early sample, model, or release of a product built to test a concept or process. Executing this in Unity lets us understand how are game will play quickly rather than wasting resource on the aesthetic.

from using these simple 3d elements we can upgrade to 2d sprites

--

--

We now have the basic gameplay for the game sorted. now would be a good time to replace some of the components with actual game art instead of boxes.

we started with a cube game object which we had the player script attached to it. Ill swap out the…

--

--

Previously using the Coroutine method we were able to get enemies spawning, this created a lot of gameobjects within our hierarchy.

to clean this up while are game is running we can make these gameobjects spawn within the spawn manager as a child and within a container.

This is a empty object created within the spawn manager. In the code we will let the spawn manager know it needs this to spawn enemies within it.

--

--

Adding to the physics in unity topic we have two methods we can call that effect our game objects. In my previous example i used OnTriggerEnter

Which activated the destroy game object instruction. this works because both objects have colliders components attached.

in the unity documentation is it explained like:

Both GameObjects must contain a Collider component. One must have Collider.isTrigger enabled, and contain a Rigidbody. If both GameObjects have Collider.isTrigger enabled, no collision happens. The same applies when both GameObjects do not have a Rigidbody component.

the other OnCollisionEnter can be used when collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. For example if we wanted to trigger a finishing line to trigger the end of a race. Gameobjects can pass through each other and an event can take place.

--

--

Using in physics in unity is done through applying the component “Rigidbody” to your game component. With this attached it will be able to respond to gravity and be able to collide with other game objects.

Rigidbody component

To help with the collision of two objects you also add a collider. this can be a box, capsule and other types

--

--