Vile Veggies – Devlog # 3 – 6.21.25
- Marcy Hyde
- Jun 21
- 3 min read
Good morning Devlog!
I did a buncha stuff over the past 2 days! Let's see...
Thursday I started the day with making a script to toggle drawers open and shut. I want to put items for players to pick up and examine inside. The script is dependent on what direction the furniture is facing so I added an enum for the dev to select what direction the drawer faces. As long as the correct direction is selected, the open toggle will pull the drawer correctly (otherwise it floats some weird direction).
I then decided to add a punching (melee attack) mechanic which became a whole battle between me and unity's animator for a while. It kept making the player float away, lose their fist and stick to walls so I opted to code the movement instead. That worked better and kept the game less laggy than having an animator component on all the time with an idle movement that was barely visible anyways. I kept losing the punching fist though. I solved this by duplicating the fist game object (turned the duplicate's mesh renderer off), which is parented to the player's body capsule and used the fist duplicate's position to bring the fist back to its original position. I also made a punchable item health script to make an item with an animator turn the animator on after its hitpoints reach zero. I went to bed before getting the fist to affect the item health using colliders/triggers.
Yesterday I started the day getting the punch to work on punchable items.
Adding a rigid body to the fist changed the fist's physics to the point of not sticking to the player body properly so that didn't work. I finally got it to work by giving the items a rigid body and making sure to make their colliders were box colliders (capsule colliders made them fall over because of their rounded bottom).
Then I hopped onto Blender and modeled a box with a clasp, learned a quick way to model a pillow using cloth physics, modeled and texture painted a hollow box to break and made a shattered form of the hollow box ( the UV map stayed the same for the shattered pieces so that's nice!).
Back in Unity I made the breakable box instantiate the shattered pieces form of it when its hp reaches zero. Each piece is its own game object with a rigid body and timed fade and destroy script. There's over 50 pieces so I may remake the fracture generation with less parts. They destroy themselves after 3 seconds right now so they aren't slowing the game down. The fade part of their fade and destroy script isn't fading their render mesh though so I'll have to see what that's about. I'd rather they do the classic game object fade away than a sudden blink out of existence but I should move onto other things for now. I then tried adding a reward inside the box that the player could find after breaking the box open. At first the breakable box's rigid body pushed the reward's collider away and forced the items to separate so I coded the reward to appear upon the box breaking instead of existing in the space all along.
Today I'll set up the examinable box with a clasp to open up and reveal another item inside, inspired by Resident Evil mechanics. First a player finds the box, interacts with it which adds it to their inventory, opens their inventory and see the option to examine it when right-clicking on the item (I think I want to change that to a hovering option menu), upon examining the box, clicking the right part of the box should activate an opening animation to reveal another item inside. I also want to model a few more items in Blender like furniture, more breakable things for the punch mechanic and more items to examine.
Toodles,
MH
Comments