Hi I’m new to unreal engine and developing games as a whole, I’ve been trying to learn some core mechanics off youtube but they don’t seem to merge well with other code or i’m doing something wrong. My specific issue is that I can still “sprint” (use my stamina) when crouching and i would like it to not allow any inputs. Any help or guidance would be appreciated!
Hi there,
Nice starting point and happy developing your game.
Like in any development environment staying organised in design and development process is the most ever important thing. Staying organised is already very important in pretty much anything So it saves you time, brain processing power.
You will see in youtube and in other places a lot of approaches doing things, maybe just answering your question. However in realworld and also in games there is known and possibly unknown a lot answers to a question.
After all this lecture you can just solve your problem again with a bool, is crouching, and on sprint check if IsCrouching not sprint. This is the simplest answer so your code knows its status.
If you want to develop your game proper way and develop yourself as a developer at the same time, solving your problem of sprinting has multiple design approaches.
- You can use a bool to detect
- You can make a simple tag system and check over there
- You can use state trees
- You can use GAS gameplay ability system
- You can make microservices. It comes handy in some cases like movement and network movement or audio.
Here is a simple tag system demo in blueprints
What is the current best way to do in unreal as designer friendly is GAS gameplay ability system, highly recommended to start practicing that as soon as possible. However it is totally ok to write your services for it too.
Sorry for the late reply! Thank you for your help and sending some useful information which i definitely look forward to learning :). I tried doing your method and for some reason it was not working, after spending countless hours today trying to fix this issue i found it was fixed by a simple Boolean that came pre packaged called Is Crouched. I didnt notice it before when i was looking for my own Is Crouching bools, and when i plugged it into my movement speeds function it worked