What is the best way to move the character while its touching the ground? Im trying to make a rolling ability, but i dont know what i should use to move the character.
I want rolling like in Egg Hunt 2018
EDIT: Please give me an ID for a rolling sound if you find one D:
There is an option in Humanoid API that allows it to move to a certain point. Hence the code piece:
Humanoid:MoveTo(Vector3.new(0,0,0))
Find a way to prevent the player from interfering with the move to, and then you can simply modify the walk speed and your rolling ability should be alright.
BodyVelocity has a problem of incorporating the object’s mass (as well as all the masses of the welded parts). I think OP would do best to avoid that if he doesn’t want to spend some time guessing and checking.
Returning sink for a context action prevents it from being ran (the name is literal - it sinks the input). Unpack takes an array and returns the elements in it.
No. BindAction automatically binds it to default priority, which is 2000. Actions can be ran with a higher priority, sink will only sink inputs that are 2000 or of a lower priority (if I recall correctly). To change priorities, use BindActionAtPriority. You’ll have to shift the last argument though: argument 4 will become the priority (Enum.ContextActionPriority.EnumItem.Value) and argument 5 will become the inputs that can trigger the bound action.
This would be interrupted by the player input. If the player is trying to move and then roll, the moveto is canceled by the fact that you’re trying to move in different directions etc. As soon as it detects input, it stops.
…If you modify the walkspeed to 0, the player cant move at all. MoveTo operates on the humanoid’s walkspeed. It’s not a measurement of how much the client can control it, it’s a measurement of how much it’s allowed to move at all. So using MoveTo and having the walkspeed to 0 stops the character from moving; making this method invalid.
I realize that MoveTo would be interrupted by player input.
Hence:
and
And you completely missed my point with modifying the walkspeed. If the OP used the method above to prevent any inputs, walkspeed can now be used as a measure of how quick the roll is. He could change it to 30, have the player MoveTo a point infront of them.
My intention was not to block input by making walkspeed 0 but rather to make walkspeed become, in a sense, roll speed and block input by another means, like the method above.
Sorry If I was not clear, but I thought the couple of replies to my post would’ve made it clear.
I already tried this and the only issue is that if you hold W and roll, after your character is done rolling, your character wont be moving forward, so you need to stop holding W and then hold it again wich will get annoying
As you can see I’m going pretty fast yet not glitching out. The way to do this is pretty easy, simply keep the MaxVelocity low. You can always increase the velocity to your liking but keep the MaxVelocity low to reduce the chances of getting flunged/glitched out.
local bodyvel = Instance.new(“BodyVelocity”)
bodyvel.MaxForce = Vector3.new(1e5,1e3,1e5) – This is what you want to keep low
bodyvel.Velocity = character.HumanoidRootPart.CFrame.lookVector * 120 – You can play around with this to fit it to your liking
now its VERY glitchy, sure, if i crash into a wall i dont start flopping everywhere, BUT now the character slides to the side randomly, and sometimes the character rolls very far, and sometimes just a bunch of studs
But since it’s just a rolling ability you could just check that the player is moving, increase the walkspeed to what you want, and play the animation. Once the animation is done you can lower the walkspeed.
It’s a hacky solution sure, but in the mean time it will produce some decent results.