I’m making a sonic game, and the Roblox Movement Controller just isn’t cutting it anymore.
The main problem Is the turning speed. When you turn you do it almost instantly, and when you’re going fast it really makes you feel slower than you are .
(fast things like cars and planes take time to turn; hence the name U-Turn)
I’ve asked and searched for solutions and everyone said to make a new movement system.
They didn’t take my stupidity into account.
Everywhere I look, I find things I
don’t understand or are out-dated (forums)
things that aren’t custom movement at all, and are named as such because they add like a slide or stamina. (videos)
any know-how in custom movement would help a lot, i need help PLEASE PLAEthank you
If it is a custom animation you can use the example for your animations to work below:
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
local animate = char:WaitForChild("Animate")
animate.idle.Animation1.AnimationId = "rbxassetid://YOURIDHERE" -- Idle
animate.walk.WalkAnim.AnimationId = "rbxassetid://YOURIDHERE" -- Walk
local runAnim = Instance.new("Animation")
runAnim.AnimationId = "rbxassetid://YOURIDHERE" -- Run
local runTrack = humanoid:LoadAnimation(runAnim)
runTrack.Looped = true
runTrack.Priority = Enum.AnimationPriority.Movement
while true do
local speed = humanoid.MoveDirection.Magnitude * humanoid.WalkSpeed
local state = humanoid:GetState()
if state == Enum.HumanoidStateType.Climbing or state == Enum.HumanoidStateType.Jumping or state == Enum.HumanoidStateType.Freefall then
if runTrack.IsPlaying then runTrack:Stop() end
else
if speed > 16 then
if not runTrack.IsPlaying then runTrack:Play() end
runTrack:AdjustSpeed(3.2)
else
if runTrack.IsPlaying then runTrack:Stop() end
end
end
task.wait(0.03)
end
(This is what i use for my R6 games, but if you use a custom rig for your sonic thing then i genuinely dont know. Keep in mind youll have to replace the ids for your animations to work (idle or walk / run)
For custom rigs and animation I made my own little system to handle animations. It also can play certain animation when character is situated on top of a certain zone.
local debounceOtherAnimation = false
local monster = script.Parent.Parent
local hum = monster:FindFirstChild('Humanoid')
local RunService = game:GetService('RunService')
local Animator = hum:FindFirstChild('Animator')
local HumanoidRootPart = monster:FindFirstChild('HumanoidRootPart')
local char = "Clickclack"
-- Idle
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://134571516820986'
local animIdle = Animator:LoadAnimation(Animation)
animIdle.Looped = true
-- Walk
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://109174517007205'
local animWalk = Animator:LoadAnimation(Animation)
animWalk.Looped = true
local originalAnimWalk = animWalk
-- Attack
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://129554810718761'
local animAttack = Animator:LoadAnimation(Animation)
--animAttack.Looped = true
-- Crouchwalk
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://106973255214955'
local crouchWalk = Animator:LoadAnimation(Animation)
crouchWalk.Looped = true
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://112988085772271'
local animLazy = Animator:LoadAnimation(Animation)
animLazy.Looped = true
local t = {}
local isAttacking = false
local allAnimation = {
animLazy
}
local AnimationName = {
'Crouch'
}
local AnimationZone = {
["Crouch"] = Color3.new(1,0,0)
}
local AnimationList = {
['Crouch'] = animLazy
}
local t = RunService.Heartbeat:Connect(function(dt)
local ALV = HumanoidRootPart.AssemblyLinearVelocity
local x = math.modf(ALV.Magnitude)
--print(x)
local player = game.Players:GetChildren()[1]
if not player then return end
local distance = player.Character.HumanoidRootPart.Position - HumanoidRootPart.Position
local disX = math.abs(distance.X)
local disZ = math.abs(distance.Z)
local raycastParams = RaycastParams.new()
local rayOrigin
local rayDirection = Vector3.new(0, -10, 0)
raycastParams.FilterDescendantsInstances = {monster}
rayOrigin = HumanoidRootPart.Position
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
local foundTrigger = false
if raycastResult then
for v,i in ipairs(AnimationName) do
if raycastResult.Instance.Color == AnimationZone[i] then
if animWalk.IsPlaying then animWalk:Stop() end
if animIdle.IsPlaying then animIdle:Stop() end
if animAttack.IsPlaying then animAttack:Stop() end
local AnimationIsAlreadyPlaying = false
for z,y in ipairs(allAnimation) do
if y.IsPlaying then AnimationIsAlreadyPlaying = true end
end
if not AnimationIsAlreadyPlaying then
AnimationList[i]:Play()
end
debounceOtherAnimation = true
foundTrigger = true
break
end
end
end
if not foundTrigger then debounceOtherAnimation = false else debounceOtherAnimation = true end
if debounceOtherAnimation then return end
if disX < 5 and disZ < 5 then
warn('omg im attacking')
-- TODO Rugor
if not animAttack.IsPlaying then
animAttack:Play()
isAttacking = true
monster:FindFirstChild('MiddleBody'):FindFirstChild('WalkingMonster00'):Stop()
end
animAttack.Ended:Connect(function()
isAttacking = false
end)
end
if isAttacking then if disX > 5 and disZ > 5 then animAttack:Stop() else return end end
if animAttack.IsPlaying then animAttack:Stop() end
-- NPC is Walking
if x > 0 then
if animIdle.IsPlaying then
animIdle:Stop()
end
if not animWalk.IsPlaying then
animWalk:Play()
monster:FindFirstChild('MiddleBody'):FindFirstChild('WalkingMonster00'):Play()
end
-- NPC is Idle
else
if animWalk.IsPlaying then
animWalk:Stop()
end
if not animIdle.IsPlaying then
monster:FindFirstChild('MiddleBody'):FindFirstChild('WalkingMonster00'):Stop()
animIdle:Play()
end
end
end)
Honestly It’s not perfect at all but it does the job, i need to rework on it
The animations shouldn’t be affected with the character/npc’s speed with this.
Running a raycast every single Heartbeat just to check for a color change is pretty inefficient. You could probably just use a Touched event or a simple region check instead of scanning the floor constantly. Also, that connection to animAttack.Ended inside the loop is going to stack up connections every time the condition hits, which is a recipe for a memory leak.
Fair enough. If you’re moving toward a real system, just make sure you decouple the logic from the physics loop. Using Heartbeat for state checks is fine, but keep the heavy stuff like raycasting or complex conditional logic out of it if you can.
The good news: custom character movement is totally doable, and you don’t need to understand every advanced tutorial out there. Let me break down what you actually need.Your core problem is that Roblox’s default humanoid uses instant rotation. You want rotational inertia—the character should take time to face a new direction based their speed, just like a real object with momentum.Here’s the practical approach:1. Keep the humanoid for basicsDon’t scrap everything. Use the default humanoid for jumping, animation states, and ground detection. You’re only replacing turning.2. Lerp the rotationInstead of setting character.HumanoidRootPart.CFrame instantly to face the input direction, use CFrame:Lerp() over a small time delta:lualocal targetDirection = getUserInputDirection() -- Your inputlocal currentCFrame = character.HumanoidRootPart.CFramelocal newCFrame = currentCFrame:Lerp(CFrame.lookAlong(currentCFrame.Position, targetDirection), 0.15)character.HumanoidRootPart.CFrame = newCFrameAdjust that 0.15 value—higher = slower turns. At high speeds, use a lower lerp alpha (0.08–0.12). At low speeds, use higher (0.2–0.3).3. Scale turning by speedCheck your character’s current velocity and reduce turn responsiveness when moving fast:lualocal speed = character.HumanoidRootPart.AssemblyLinearVelocity.Magnitudelocal turnAlpha = math.max(0.08, 0.2 - (speed / 100)) -- Slower turn as speed increases4. Use RunService for smooth updatesRun this in RunService.RenderStepped (client-side), not heartbeat. This gives you 60fps precision.That’s honestly 80% of it. Start there, tweak the numbers, and test. You’ll feel the difference immediately.
Calling someone an AI farmer just because they gave a structured answer is a bit much. The advice on using Lerp for rotation is actually solid and much better than just snapping the CFrame.
Roblox just recently made a library to use the new character controllers! These controllers have a turning speed and other things like acceleration speed and max forces.
That library is a much better way to handle this than manually lerping CFrames. It’s cleaner to use the built-in physics properties than trying to override the humanoid behavior with custom scripts.
“Structured answer” is a little bit of a stretch my guy. It’s literally a lump of unreadable text, just because AI can summarize what he said for you doesn’t mean it’s coherent for the rest of us. “They” is also a stretch because ChatGPT gave that answer, not him. Which is what makes him a forum farmer.
Besides his advice isn’t even good, moving the character via raw CFrame/Vector manipulation is a terrible idea in 99% of cases.
The CFrame manipulation isn’t a terrible idea if you’re just handling rotation, but the formatting of that post was definitely a mess. If you’re going to use the new character controller library like noblemaxx suggested, you won’t even have to deal with that manual CFrame logic anyway.