-
What do you want to achieve? Keep it simple and clear!
I want my character to tilt in the direction they dodge using a single animation with an R15 Rig. -
What is the issue? Include screenshots / videos if possible!
Currently the way I’m trying to make it work is by tweening the LowerTorso Root toward the direction I want the dodge to go, the problem is if the key for dodging is spammed (Q) it can offset the character’s orientation well after the dodge is complete.
https://gyazo.com/11f4f44de21fa35f24034ec964794c40
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried it with and without the tweens (BodyGyro), but the most effective method seems to be tweening unless there is another method I am missing.
elseif key == "q" then
-- quickstep!
local camData = {}
camData.CFrame = Camera.CFrame
camData.Focus = Camera.Focus
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
0.2, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local original = lTorso.Root.C0
--local TweenCenter = TweenService:Create(lTorso.Root, tweenInfo, {C0 = CFrame.Angles(0, 0, 0)})
local TweenLeft = TweenService:Create(lTorso.Root, tweenInfo, {C0 = original*CFrame.Angles(0, 0, 1)})
local TweenRight = TweenService:Create(lTorso.Root, tweenInfo, {C0 = original*CFrame.Angles(0, 0, -1)})
local TweenFront = TweenService:Create(lTorso.Root, tweenInfo, {C0 = original*CFrame.Angles(-1, 0, 0)})
local TweenBack = TweenService:Create(lTorso.Root, tweenInfo, {C0 = original*CFrame.Angles(1, 0, 0)})
local speedMod = Humanoid.WalkSpeed
local moveDir = Vector3.new(0,0,0)
if UIS:IsKeyDown(Enum.KeyCode.A) then
moveDir = moveDir+Vector3.new(-1.5,0,0)
TweenLeft:Play()
end
if UIS:IsKeyDown(Enum.KeyCode.D) then
moveDir = moveDir+Vector3.new(1.5,0,0)
TweenRight:Play()
end
if UIS:IsKeyDown(Enum.KeyCode.W) then
moveDir = moveDir+Vector3.new(0,0,-1.5)
TweenFront:Play()
end
if UIS:IsKeyDown(Enum.KeyCode.S) then
moveDir = moveDir+Vector3.new(0,0,1.5)
TweenBack:Play()
end
moveDir = (moveDir == Vector3.new() and Vector3.new(0,0,1.5) or moveDir)
camData.moveDir = moveDir
fcd = true
local data = {key="q",state="down",camData=camData,speed=speedMod}
local succ = movementRemote:FireServer(data)
fcd = false
end
end)