Good evening! Today is Day 37 of my 60 day challenge to become a Unity Game Developer :)
Today I got to continue to work on my cinematography game, specifically the player’s behavior.
Check out how far my player has come!
If you remember from my earlier post, this is what he used to look like…
Let’s break down a few things going on here:
The first thing that needed to happen was fixing the issue of my player walking through objects. You can’t really see it in the gif above but there was some adjustments that needed to be made to ensure that the player would not be able to through objects. Luckily, all that needed to happen was to make the objects static in the inspector. They were all neatly grouped together which made it super easy fix.
Another thing that was updated was how the camera changes its view as the player moves across different points on the board. What was nice was that provided with the game package was camera progression angles which holds specific angles, rotation, scale and position for the main camera at different points, as well as the trigger points which should “activate” each respective camera.
Because there needed to be a way to detect a collision between the player and the trigger points, a rigidbody needed to be added to each camera trigger to provide the physics. Also the isTrigger bool needed to be set to true on the box collider component which was already included on each camera trigger. This is what allowes for the trigger detection.
From there just needed to create a script to attach to each camera trigger which creates a transform variable and sets the position and rotation to that of each of the camera progression angles. Since the variable is public we can drag and drop each camera angle to its corresponding trigger point.
Some other stuff that I worked on:
- Changed Darren from a capsule back to his original self by adding his prefab as a child component to the player game object and turning off the parent object’s mesh renderer.
- Adjusted the main camera so that it always looks at the player by creating a transform variable to be used as a target. By using the transform.LookAt() and referencing the Player transform in the inspector this behavior was achieved.
- Created the walking and idle movements using animator and animation.
This is done by creating a parameter called “Walk” which is set to either true or false depending on if the player has reached its new position.
- Being ok going at a slightly slower pace.
Tomorrow is Thanksgiving. Despite all of the 2020 craziness I am extremely grateful to be one of the lucky ones who do have a lot to be thankful for; This internship is high on that list. Wishing whoever reads this a safe and delicious Thanksgiving :)
When I get back at it either tomorrow or Friday, I will continue on this journey of setting up the character logic for this game. Enemy behavior is up next!
See you then.