I made a few minor adjustments to the HUD here, but nothing is functional yet; it wasn’t my main focus.
I made a custom skin (still a very much a WIP) for Game Creator’s Inventory system (had not made one for “containers” as of yet) and managed to get the flashlight object I had made as a working equippable. This was actually quite a complicated little thing to do.
The flashlight I created was saved as a prefab, and was not yet instantiated into the game at the beginning. Once you equip the flashlight, it instantiates the flashlight prefab as a child of the player object (so it will move with the player). This took some really specific placement modifications too for the instantiated object to be facing the right direction, especially when the player was facing a direction other than toward the camera. When they weren’t, the flashlight would instantiate at a weird rotation, so it wouldn’t necessarily be in front of the player. I remedied this by zeroing out the Flashlight prefabs rotations to 0, and putting the actions in this order:
- 1. Instantiate the Flashlight and store it in a Global Variable (“EquippedFlashlight”)
- 2. Change Parent of Global Variable “EquippedFlashlight” to Global Variable “CurrentPlayer”
- 3. Change Position (aka Move) of Global Variable “EquippedFlashlight” to [my specified coordinates for X,Y, and Z; these coordinates will change in the future when I have actual sprites but for now the tweaks to this position make it look like it’s in their right hand)
So, for now at least, the basic Flashlight functions were taken care of. As I noted above, this situation will more than likely change when I start using actual sprites, but for testing, it’s all good!
You’ll also see that I added organization tabs for the inventory at the top of the menu (which will also be changed in the future, but practice practice practice).
Also in the future, the Flashlight will be a left-handed item, as left-hand items will be supporting items and right-hand will be weapons. This will play a part in the mechanics, and makes the sprites a little more fluid and “realistic” (usually you can “mirror” sprites but that swaps things around and makes the imagery inconsistent, so I’m making sure to keep things organized).
This video was recorded on December 26, 2020.