Hello, I have an animation that plays once a player is hit making them roll very far back, however, their CFrame stays right in front of me and since this attack finisher is for range, I end up attacking myself since I cant make it hit the CFrame of the target player.
How can I move the CFrame to the end position of the animation?
I highlight the HumanoidRootPart to show you that it doesn’t move with the animation.
Let me elaborate a bit more on it aswell. This is a two part attack, the beginning punch is to activate the actual finisher, which is a pawn chess piece being slammed onto the target player. I didn’t show that in the first video because the piece would drop on me, which I found to be due to the targets CFrame being stuck in the position where it was punched, which is right in front of me. Its like I havent even punched the player if that makes sense since its body is animating but the actual player is still right there.
Yes and sorry about the video, In the first clip I used software built into my pc but it wouldnt work after second time for some reason. Basically I am trying to get the CFrame which youre able to see in the first video, right in front of my player, to move either with the animation or to the animations ending.
Is this a tween or animation? If its a tween have you tried setting the PrimaryPart of the model to the HumanoidRootPart and using SetPrimaryPartCFrame()?
Maybe im in a little over my head, how would I update the rootpart while its animating? If you wouldnt like to go into that much detail maybe theres a wiki somewhere for this specific thing you could provide me? Otherwise:
if animator then
local chessTarget = game:GetService("StarterPlayer").StarterCharacterScripts:WaitForChild("CiaranChess").ChessTargetHit -- Replace with correct animation path
local targetAnim = animator:LoadAnimation(chessTarget)
targetAnim:Play()
targetAnim:GetMarkerReachedSignal("updaterootpart"):Connect(function()
target.HumanoidRootPart.CFrame =
end)
targetAnim:GetMarkerReachedSignal("repeat"):Connect(function(TimePosition)
targetAnim:AdjustSpeed(0)
task.wait()
AC:FireClient(player,target)
end)
Would I start that way or, how would I go about it?
if animator then
local chessTarget = game:GetService("StarterPlayer").StarterCharacterScripts:WaitForChild("CiaranChess").ChessTargetHit -- Replace with correct animation path
local targetAnim = animator:LoadAnimation(chessTarget)
targetAnim:Play()
targetAnim:GetMarkerReachedSignal("updaterootpart"):Connect(function()
while targetAnim.IsPlaying do
target.HumanoidRootPart.CFrame = target.Torso.CFrame
game:GetService("RunService").RenderStepped:Wait()
end;
end)
targetAnim:GetMarkerReachedSignal("repeat"):Connect(function(TimePosition)
targetAnim:AdjustSpeed(0)
task.wait()
AC:FireClient(player,target)
end)
This did work, so thank you, however I ran into a new issue which I thought I would know how to fix but I guess not.
Since the HRP updates to the spot of the player during the animation, it just moves the animation a whole length further, basically flinging it into the void. I tried fixing this by anchoring the HRP and as a separate fix changing the walkspeed before the GetMarkerReachedSignal function.
Both did not solve my issue and the closest fix I found for it was deleting the GetMarkerReachedSignal and putting the code that was in between it into the repeat signal function as then since the players animation would be paused, maybe it wouldnt fling, and it doesnt but the player disappears right when it happens and oddly the chess piece slams at an angle.