top of page

Logger

Cap to inventory size

January 22, 2025

I added a cap to the inventory size, this was just an int on the script with a check before picking up and dropping items in containers.

Container.gif

First Container

January 20, 2025

I reused the inventory system from the player inventory and when the player is in range of a container if they press the drop button it will instead get added to the containers inventory.

Container.gif

Inventory system, V1

January 10, 2025

Every interactable item (so far only the log) implements the IInteractable interface which defines MakePickedUpState and MakeDroppedState as well as GetObjectSizeOffset.

The 2 first are to disable colliders, physics and other which could be needed depending on the item and the last is to get the stacking offset (how far up the next log should be basically).

The inventory (and in the future other containers) implement the IContainer interface which defines AddToContainer and RetrieveFromContainer.

The inventory works by making the object that is picked up into its PickedUpState with the function explained at the start. It then gets sent to the inventory which adds it to a stack (actual data inventory) and then places the object at the current item position. The current item position is then moved up by the objects ObjectSizeOffset to ensure correct positioning for the next object.

To drop the object the same logic is followed in reverse.

Pop top item in stack, move down current item position with offset, make object dropped state, and drop it in front of the player.

There are still some bugs and i also need to add a cap to the amount of logs the player can carry, but so far so good.

Inventory.gif

Chopping down trees

December 21, 2024

I implemented a very basic tree chopping logic. If there is a tree nearby and the player presses mouse 1 damage will be applied to the trees "hp bar", when it reaches 0 the tree will be chopped.

Right now the falling of the tree is just the same tree object but with a rigidbody that gets a force applied to it. A log also spawns.

In the future a better falling animation will be created and I want to make logs spawn where the tree fell.

Tree Chopping.gif

Movement / Camera

December 20, 2024

I implemented a movement system for the character using the new unity input system and unity character controller. Player moves with WASD.

I implemented a rotating camera with Q/E to allow the player to rotate the camera to avoid awkward angles but still allow movement with WASD and rotation with the mouse.

Movement and Camera.gif
bottom of page