#How do i fix my directional rotation movement system it keeps messing with the walk animation
1 messages · Page 1 of 1 (latest)
looks fine ..?
i mean whats wrong?
can you show this more clearly?
i dont see anything wrong in the video you showed, maybe its subtle but a clearer recording will help
wanna go in voice so i can stream?
you aint paying me enough to do that. if you can summarize and depict your issue better, and get better at doing that, it will make you a better developer on its own. free practice 
so how are u gonna know nvm
heres the code
local rs = game:GetService("RunService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local trs = char:WaitForChild("Torso")
local leftleg = char:WaitForChild("Left Leg")
local rightleg = char:WaitForChild("Right Leg")
local rootJoint = hrp:WaitForChild("RootJoint")
local neckJoint = trs:WaitForChild("Neck")
local leftHip = trs:WaitForChild("Left Hip")
local rightHip = trs:WaitForChild("Right Hip")
local oriRootJointCF = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local oriNeckJointCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local oriLeftHipCF = leftHip.C0
local oriRightHipCF = rightHip.C0
local tilt = CFrame.new()
local maxTilt = 20
local legtilt = 10
rs.RenderStepped:Connect(function(delta)
local moveDirection = hrp.CFrame:VectorToObjectSpace(char.Humanoid.MoveDirection)
local xTilt = -math.rad(moveDirection.X) * maxTilt
tilt = tilt:Lerp(CFrame.Angles(0, 0, xTilt), 10 * delta)
rootJoint.C0 = oriRootJointCF * tilt
neckJoint.C0 = oriNeckJointCF * tilt:Inverse()
leftHip.C0 = oriLeftHipCF * (tilt * CFrame.Angles(0, 0, xTilt * 0.3))
rightHip.C0 = oriRightHipCF * (tilt * CFrame.Angles(0, 0, xTilt * 0.3))
end)
why are you messing with the joints
local xTilt = -math.rad(moveDirection.X) * maxTilt that's the only tilt you're dealing with, that's probably why there's a problem with one axis, because there is only the x axis. where is the code to deal with zTilt?
XZ is horizontal movement, but you only have X in there 👍
k
i'm not sure about how your math is playing out exactly, but the fact that Z isn't factored in at all is a clear part of the problem
thx
normally animations just simply deal with this as part of animating but if you want to animate manually like that... well that's where i'd start 
so like this right ```local rs = game:GetService("RunService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local trs = char:WaitForChild("Torso")
local leftleg = char:WaitForChild("Left Leg")
local rightleg = char:WaitForChild("Right Leg")
local rootJoint = hrp:WaitForChild("RootJoint")
local neckJoint = trs:WaitForChild("Neck")
local leftHip = trs:WaitForChild("Left Hip")
local rightHip = trs:WaitForChild("Right Hip")
local oriRootJointCF = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local oriNeckJointCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local oriLeftHipCF = leftHip.C0
local oriRightHipCF = rightHip.C0
local tilt = CFrame.new()
local maxTilt = 20
local legtilt = 10
rs.RenderStepped:Connect(function(delta)
local moveDirection = hrp.CFrame:VectorToObjectSpace(char.Humanoid.MoveDirection)
local xTilt = -math.rad(moveDirection.X) * maxTilt
local zTilt = -math.rad(moveDirection.Z) * maxTilt
tilt = tilt:Lerp(CFrame.Angles(zTilt, 0, xTilt), 10 * delta)
rootJoint.C0 = oriRootJointCF * tilt
neckJoint.C0 = oriNeckJointCF * tilt:Inverse()
leftHip.C0 = oriLeftHipCF * (tilt * CFrame.Angles(zTilt * 0.3, 0, xTilt * 0.3))
rightHip.C0 = oriRightHipCF * (tilt * CFrame.Angles(zTilt * 0.3, 0, xTilt * 0.3))
end)```
what the hell
i tried it
and its like
worse
why am i walking forward liek this
@modest marsh
help meeeeeeee
i don't know, is this your code?
chatgpt isnt good for stuff like this ;o
you still haven't answered this one, nor explained what exactly you're trying to do
no i found an dev post so it can help with what im doing
it worked
but only for the torso
and i wanted it to be more realistic
so i added in the legs to
then
._.
what are you trying to do
you mean in the video where you strafe left/right and the torso turns a bit in that direction?
with the shiftlock on?
I want to make a fighting game, focusing on the old first aethelbeorn and other games. I will be glad to see your feedback in the comments!
i wanted to but no
im close to that but
yeah
see
but irs not working
pls help me @modest marsh
if you want me to help you have to answer the questions i ask
and i need you to be specific, is this what you are asking about?
no like in all dierections it will rotate based on if ur moving in more of a right dierection or a left dierection
the toror and the legs
well the legs are connected to the torso so if you rotate the torso, the legs also rotate
if you got the torso working just fine, shouldn't have to do anything for the legs
but it sounds like you starting to enter objectspace with this, because you only have X in the stride, that would work in objectspace, but not in worldspace, and since you want to animate manually, the math gets a bit tricky
and i want my floors mopped yet here we are, both having to put in work
no
no no
not animate manualt
manually
thats for later i just wannt get the rotation down
that's what the code you posted does; animates the legs manually by messing with the joints
NO
rootJoint.C0 = oriRootJointCF * tilt
neckJoint.C0 = oriNeckJointCF * tilt:Inverse()
leftHip.C0 = oriLeftHipCF * (tilt * CFrame.Angles(0, 0, xTilt * 0.3))
rightHip.C0 = oriRightHipCF * (tilt * CFrame.Angles(0, 0, xTilt * 0.3))```
i'm very confused to what you're asking for
omg
your video looked fine?
