What’s the best way to make this animation follow the players movement?
so the player doesn’t go back to their default position once the animation ends
and the camera also follows them
i looked up solutions but they were still doing the same thing
What’s the best way to make this animation follow the players movement?
so the player doesn’t go back to their default position once the animation ends
and the camera also follows them
i looked up solutions but they were still doing the same thing
Roblox’s default walk animation and dashes in fighting games are a good example of this
You’d pretty much animate the character under the assumption that the root part is shifting during the animation
so let’s say at the end of the animation, your character is supposed to end up 5 studs in the X direction and the animation is 5 seconds long
I’d animate it so at 5 seconds, the torso or lowerTorso, whichever part is directly attached to the root part, is -5 studs compared to where it should be; at 2.5 seconds, that part would be -2.5 studs compared to where it should be
then in your code, when you play the animation, you’d shift the rootPart by whatever offset it should have at whatever given time
^ this is only if the rootPart is supposed to move in a linear speed though. it should be a little intuitive to move it at an inconsistent speed once you have that setup
like this? how do i see the distance for each keyframe? for the torso or whatever so i can send events to make the player go forwards?
that looks like way too much movement
I meant like at the end of your animation when you set the LowerTorso’s position to something like (0, 0, 5), instead, you need the humanoidRootPart to be at (0, 0, 5), so you’d set the lowerTorso to (0, 0, 0) which is -5 in the Z direction
you can see the position using the white triangle on the left of the limb’s name in the animation editor
Oohhhh so like this?
yes, then you’d have a script handle the movement of the humanoidRootPart when the animation is played
idk the rate of movement your animation does, but it looks like you only have 6 frames and they’re each linear, so it shouldn’t be too much
im not sure how to do that ? the animation is playing but the character is teleporting and idk how to fix it
tool.Activated:Connect(function()
AnimTrack:GetMarkerReachedSignal("NewAnimation"):Connect(function()
AnimTrack1:Play()
local HumanoidRootPart = Humanoid.Parent:WaitForChild("HumanoidRootPart")
local TweenService = game:GetService("TweenService")
AnimTrack1:GetMarkerReachedSignal("Move1"):Connect(function()
--LookVector
local Info = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0)
local Goal1 = {
CFrame = CFrame.lookAt(Vector3.new(0,0,2),Vector3.new(0,0,2),Vector3.new(0,0,2))
}
local Tween1 = TweenService:Create(HumanoidRootPart,Info,Goal1)
Tween1:Play()
end)
AnimTrack1:GetMarkerReachedSignal("Move2"):Connect(function()
end)
wait(1.07)
AnimTrack1:Stop()
end)
end)
workspace.Part.CFrame * CFrame.new(0, 0, -5)
this is an example of a cframe 5 studs in front of a part’s cframe with the same orientation
i used body velocity and it worked!! thanks for your help ya’ll!! i don’t think is the best method but it’s what is working for me right now
local bv = Instance.new("BodyVelocity",HumanoidRootPart)
bv.MaxForce = Vector3.new(99999,0,99999)
bv.Name = "v"
bv.P = 10
game.Debris:AddItem(bv,.2)
bv.Velocity = HumanoidRootPart.CFrame.LookVector * 50
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.