in my game walkspeed is one key to immersion and its being changed a lot from script to script.
currently im doing (humanoid.WalkSpeed - reductionamount) to reduce it and
(humanoid.WalkSpeed + reductionamount) to speed up, so its dynamic, if im sprinting and im supposed to slowed down, ill just be slowed down less since im sprinting and if i stop sprinting, ill be at the value i originally want to be when im supposed to be slowed
i really dont know if im making a stupid easily circumventable mistake here but im not sure how to handle it anymore since all i get by doing that is crazy low or crazy high walkspeeds if i were to overlap functions that change walkspeed, which would be normal in my games gameplay
this aspect is KEY to my games gameplay and im not sure how to go about it anymore
If I’m understanding correctly, you are attempting to create a sprinting system by manipulating the walkspeed of the character. However, the walkspeed is not constant and is changed in different scripts. Am I correct?
yes, i have a sprint and crouch system, but i also have multiple scripts that manipulate the characters walkspeed as well, and it always ends up being something else due to the functions delaying or overlapping i really dont know
Keep in mind, mobile users and controller users have a linear threshold on their thumbstick. By that, I mean, let’s say players have several “moving” states. Walk, jog, and run. If you account for each of these by altering the walkspeed, thumbstick users won’t be limited to those exact speeds, they can still go well below those speeds. Let’s say the Walkspeed is set to 16, and I’m a thumbstick user. If I barely touch the input, I get a very, very slow walk. Even with Walkspeed at 100, barely touching the thumbstick can give you less than 10 studs per second. The way to fix this is, when input is detected at a certain threshold, lock the Walkspeed and force the player to move in that state.
you are seeing the wrong problem here, this isnt about mobile and controller users, its about pc users and overlapping walkspeed functions resulting in unconstant walkspeeds
eg sprinting changes walkspeed to walkspeed + 5 and another script changes that and another one as well (the functions reverse, so the walkspeeds will be subtraced the same amount that was added to them, so it reverts) and in the end the default should be lets say 14, but i end up w 21
It sounds like you need a script that listens for requests to change the walkspeed, and only allows changes to occur when it receives only one request to change the speed, or balances the priority of certain actions to prevent overlap!
I heard that AxisAngles (mathematicas phantom forces dev) recommends VectorForce for custom character movement. You should use a cylinder as the collider, but stairs will suck a lot. Use ApplyImpulse to apply your own forces (such as knockback) and VectorForce for counteracting Roblox’s forces.
You can have a server script that collects a table of players, then uses the CollectionService to tag players when they’re able to change Walkspeed.
if not CollectionService:HasTag(Player,"Changing") then -- If they don't have the tag
-- now make changes to walkspeed
else
end
This method is definitely not the fastest, because I didn’t use Remotes or Bindables, and handled it all on the server. But this is the premise “can they update walkspeed or not”