So I’m trying to make a “kill effect” for my game, but I ran into an issue. The kill effect I’m trying to make is a grave that appears on the place that the player died. A pile of dirt tweens from the ground to the dead players torso, then a grave tweens from the air to the spot it’s supposed to be. The problem is, everything is inside of one model, therefore the model has to move upwards for the grave (inside the model) to appear. For some reason the grave has decided to tween itself underground to the place the end position was before the model moved upwards. If you don’t understand, here’s a few images:
dirt after model tweening up the grave end position the grave is supposed to go
The grave is underground instead of the place it’s supposed to be.
Any help is appreciated
Sorry for the wait, here it is: (I forgot to mention, everything in the model is connected with motor6ds)
wait(0.5)
local char = plrr.Character
char.Head:Destroy()
for _, v in pairs(char:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v.Transparency = 1
end
end
wait(0.2)
local grave = game:GetService("ReplicatedStorage").killEffects.grave:Clone()
local tors = char.UpperTorso
grave.Parent = workspace
grave:SetPrimaryPartCFrame(CFrame.new(Vector3.new(tors.Position.X, tors.Position.Y - 8, tors.Position.Z)))
wait()
local ti = TweenInfo.new(1.25,Enum.EasingStyle.Linear,Enum.EasingDirection.In)
local goal = {
Position = Vector3.new(tors.Position.X, tors.Position.Y - 1, tors.Position.Z)
}
tweenservice:Create(grave.PrimaryPart, ti, goal):Play()
wait(1.26)
for i, v in pairs(grave:GetDescendants()) do
if v:IsA("Motor6D") then
v:Destroy()
elseif v:IsA("MeshPart") or v:IsA("Part") then
v.CanCollide = false
v.Anchored = true
end
end
wait(0.5)
local goal2 = {
Transparency = 0,
CFrame = grave.position.CFrame
}
tweenservice:Create(grave.grave, ti, goal2):Play()