Does anyone know how I can get the position/CFrame of an object during an animation (not tween)? This is because the position/CFrame doesn’t update during animation.
You can use the CFrame property of the HumanoidRootPart of the character that is being animated. The HumanoidRootPart represents the root bone of the character’s skeleton, and its CFrame property gives the position and orientation of the character in the world.
Yea, the HumanoidRootPart does update its CFrame during animation. When an animation is played on a character, the Humanoid object updates the positions and orientations of the bones in the character’s skeleton, which in turn updates the CFrame of the HumanoidRootPart .
here’s an example
local character = script.Parent.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
local rootPart = humanoid.RootPart
local animation = humanoid:LoadAnimation(<animation>)
animation:Play()
while animation.IsPlaying do
local currentPosition = rootPart.CFrame.p
print(currentPosition)
wait(0.1)
end
end