So I’ve been toiling away on my first game project, and I wanted to make sure I wasn’t putting too much into my On Tick event for my character controller:
I know it’s alright to have some things run on tick, I just don’t want anything silly and/or unnecessary and I’m too much of a novice to tell. Please, lend me your guidance!
The tasks in order are:
1.) Check if the player is being crushed to death. For some reason this is a very difficult thing to determine since most of the time the player will clip through an object before it discerns I’ve been crushed. So I ended up using a bunch of Capsule traces to try and guess when the player’s in a spot too small for them.
2.) Check if the player’s head is below a water plane. This is just a line trace shooting straight up, checking for anything with the Liquid tag.
3.) Check for Wallrun. I used to do this on-hit, but I kept encountering issues where the On Hit event wouldn’t trigger. So instead I now have two capsule traces running on either side to detect overlap with a wall. I also tried to do this with trigger volumes on the controller itself but they also wouldn’t trigger. If there’s anything I’d like to keep on tick it’d be this.
4.) Dynamically change the FOV based off the player’s velocity.
5.) Update player’s ‘starting’ sliding speed. This one I feel should be easy to move off, but I keep encountering something like a race condition, where if I don’t keep track of the starting speed before the slide actually begins, it’ll not inherit the correct velocity. I also need to check to see if the player is standing on a slope that’s too steep, and if so force them into a slide state. This is different from the ‘walkable angle’ auto-slide, which is really just falling in style, no?
6.) Dynamically play a sound based off player velocity, similar to 4.