Benefits of Prototyping without Assets
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
From Prototype to Work of Art
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 cup for a 2D ship from GamedevHQ library
Spawning Objects in Unity without the Clutter
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.
Script Communication in Unity using GetComponent
Script communication is a function I have taken time to understand within unity. Using gameobjects within unity to make a game everything is done through scripts and to make our ideas come to life these objects need to interact with each other. example here of our scripts. we haev an…
OnCollisionEnter Vs. OnTriggerEnter — When to use them?
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.
Introduction to Physics in Unity
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. To help with the collision of two objects you also add a collider. this can be a box, capsule and other types