Hey guys, I would appreciate some help here. So I’m working on a survival game and I’m currently working on my resource gathering system.
How I’ve set it up (which could be a bad way, and if it is please tell me) is by attaching a collision box to my tree actor and if the player character is inside the collision box and presses LMB, it takes 1 health away from the tree, and adds 1 wood to the player inventory. When the tree health reaches zero, it deletes the tree.
This worked pretty well, until I realized that in most survival games the player can hold LMB down and it automatically gathers every time the character swings for as long as they hold it. So my question today is, how do I add this into my game, while keeping the gather rate in sync with my tree chopping animation?
P.S. I thought about adding a loop with a delay the same length as my chopping animation, but I feel like this is a clunky way of doing it and it would screw up down the line.