Posts

I made an old western style horse drawn cart using maya 2018 and it turned out rather well, i think ill keep creating models in a old western style as a theme since i have not really decided on a theme yet so this should help my thought process for the rest of the game design.
After spending the past couple of weeks struggling to fix the camera issues of it clipping through the floor and being far to close to the player character so much so that it also clips through said character I have decided to move on to working on the potentially final models for the character, enemies and level design and come back to the camera issues at a later date.
Having a working HUD is nice seeing the health bar move when taking damage and putting in multiple hits to enemies before they fall to the ground lifeless being shoved out the way by the rest of the horde of cube bots and having the cube bots find the shortest way around objects towards the player and having the small effects of light flashes going off when shooting at them is enjoyable and would certainly add to the experience if it was polished. Unfortunately, there’s problems with the camera positioning which in future versions or attempts I would like to fix so that it is no longer so close to the character and large that it clips through the bottom of the environment and the player but should be achievable with a few minor tweaks in the unity editor with the positioning. I would also like to add sound effects to the game in future such as background music and gun sounds when shooting maybe even some sounds when taking damage and on death would possible. Of course, I would like to ...
Then with the player selected in the hierarchy look at the apply button if we click on the apply button what that will do is if we have a prefab the changes we have made to the objects or scripts will update to the prefabs. Now to move onto spawning enemies to start with go to the hierarchy and create empty object and name it enemymanager then create a script name Enemymanager and drag it onto the EnemyManager in the hierarchy now create another empty in the hierarchy and rename it CubeBotSpawnPoint and position it in the scene view to wherever you want the enemies to spawn from.  So now if you click on the EnemyManager in the hierarchy you will see some boxes with None in which we don’t want so click and drag the player from the hierarchy onto the player health property in the EnemyManager which will link it to the player health script so that enemies only spawn while the player is alive then there’s another section for enemies so take a cubebot or enemy from either the ...
We then want to make sure the enemy can attack the player so what we do is make a new script named EnemyAttack and drag it onto the enemy named Cubebot as well as making sure the player can harm the enemies or Cubebots to do this create another script named Enemyhealth and drag it onto the enemy or Cubebot to apply the script. Then to make sure that the gun fires in a line I attached a 3D cube that I scaled down to use as a gun and added a particle system component to the cube gun, I then added another component called line renderer which does as it names suggests renders a line expand the materials tab via the dropdown and click on the circle select via the element 0 and is ideal to use a basic line render material which can be gotten from the asset store or other sources, we then want to expand parameters and set start width and end width to 0.05 then disable the line render check box at the top.  Now add a new component by going into rendering and selecting light this i...
Now to implement player health that interacts with the UI to do this create a C# script in the script folder then drag the script onto the player in the hierarchy, in the components section of the player in the player health section you will see Health slider and damage image with None in the boxes next to them you need to click on the health slider in the hierarchy and drag it onto the box with none which will link the health slider component with the player health script do the same with the damage image box below by dragging the damage image from the hierarchy into the damage image none box to link it. 
Next will be creating the HUD so to start there’s a 2D button located at the top of the scene view which if you click on will change the view to that of 2D which is helpful for setting up the HUD. So, what we want to do is create a canvas which can be done by going the game object tab mouse over UI and clicking on canvas which will then place a canvas in the hierarchy after which rename it from canvas to HUDCanvas (heads up display). Then add a component called Canvas group which allows UI elements to have an alpha and whether their interactable, then uncheck the Block raycasts box.  Then right click on HUDCanvas in the hierarchy tab and click create empty which will create a child and rename the gameobject to HealthUI, the benefits to doing it this way instead of creating an empty then linking it to the HUDCanvas is that if you create the child directly unity knows that your trying to add a new HUD element and gives it the rect transform instead of the normal transform. Now to m...