It a game where a kid is having a nightmare about his toys coming to life and trying to kill him. And the player has to shoot all the zombie toys until he dies (you can't win the game sadly) :(.
I downloaded the asset pack for this tutorial and imported it in the game.
I imported the environment prefab and the lights into the scene which was already set up before hand in the asset pack.
Since the surface is rough I had to add a quad and scale it up so it fills the whole place with a bit of headroom around the map for when I use the ray cast.
Now that white everywhere looks kinda dumb so I had to disable the mesh renderer.
And now it has the border so you can see it but the mesh isn't rendered at all so it's invisible.
Now next what I did was add a player to the scene which was already set up in a prefabs and I reset his transform position.
Now I made an animator controller and put on on the player and opened it up in the animator.
Now I dragged the animations for the player inside and arranged them in a sort of way and made links between them XD
Now I made 2 parameters: one boolean called IsWalking, and trigger called Die. And inside the switch from Idle to Move I made it if isWalking is true and if isWalking is false, set it back to idle. Now i want it to be possible to die in any state so I made the any state transition to death is Die is true.
Now I made a code called PlayerMovement and started programming.
I added some variables, an awake function, a fixed update function, a move function and an Animating function.
It's would take a while to explain what I did but hopefully the comments will help you understand what I did.
In layman terms I'm pretty much making the player move along the X and Z axis and shooting a ray down to the quad and makes the player face the position of the mouse on the quad.
After this I set up the camera in Unity above the player and pointing down a bit, then I made it an orthographic camera.
This is how the game looks so far.
Tomorrow I will be continuing the tutorial.
No comments:
Post a Comment