kind of a weird question but how do you go about picking the best solution? Like you know how to solve an issue, but you have a multitude of paths to go about it
my current example
I got this state system and it utilizes the Onleave + Onenter pattern, but doesn’t actually use it in its intended fashion, if that makes sense.
I was in the middle of adding a new functionality, and I was wondering how I can stop certain states without manually tampering with it too much, and there were a multitude of ways I though of like-
do a signal system on client to stop animations for clean-up
or just make Onleave and Onenter actual functions and then completely rework my whole FDA system to an official FSM system
or I could just manually stop it by doing an if statement
but I really don’t know the proper way to go about so I’m just a bit stumped in all honesty
I usually pick the way that gives me the least troubles and works the same as the others lol. To me it’s pointless picking the ones that you know will make you waste much more time than others but it’ll have the same and result.
For example:
Unsure how your system works so can’t really say much on this.
Remaking the whole system sounds like something that will take you quite a lot of time. Unless it’s buggy/glitchy or doesn’t work I don’t see a reason to recreate it.
Sounds like a quick and simple way to fix the issue. I’d probably pick this.
As I said already, I don’t know your system and how it works so I can only give my opinions based on the context given here
For a bit more context, I’ll provide some code and explain my system a bit more in depth.
Right now I kind of have a FDA setup for a State System. I’m using the OnEnter and OnLeave pattern so I can make things easier on myself in terms of checking which actions are allowed or not.
I’m currently working on the functionality for my Running State, and I have the functionalities of states activated on the Server
ServerStorage.BindableEvents.SignalControl.Event:Connect(function(Player, State, Activity, Duration)
local Character = Player.Character
local Humanoid = Character.Humanoid
if State == "Blocking" then
BlockStatus:Block(Player)
elseif State == "Running" then
SprintingStatus:Sprint(Player)
end
if Activity then
if State == "Stunned" then
print(Character, Duration, State)
StunStatus.Stun(Character, Duration, State)
elseif State == "SwingStun" then
StunStatus.Stun(Character, Duration, State)
end
end
end)
My biggest issue is the Running system, and how Animation and actual functionality for running is separate completely.
I can’t stop the animation on server particularly, so I’m just stuck wondering what kind of method I can go for to make this system work better, and possibly if I need to change the system so I’m not trying to go through complexities to make stuff like this happen each time I want to “Clean up” a state’s previous actions.
Running’s actual functionality:
function SprintingStatus:Sprint(Player)
local Humanoid = Player.Character.Humanoid
local SprintingTruthy = WrapperPlayer:GetState(Player, "Running")
local GetStates = WrapperPlayer:GetStates(Player)
--print(SprintingTruthy)
if SprintingTruthy == false then
--print("goodbye")
Humanoid.WalkSpeed = 12
elseif SprintingTruthy == true then
--print("hello")
Humanoid.WalkSpeed = 20
end
end