I have made various training dummies in my game where you gain stats by attacking them.
I made an animation that plays each time the dummy is attacked of getting knocked down and bouncing back up and it works great except for when the dummy respawns. Once I makejoints, the head and torso of the dummy are set to cancollide = true and I can’t get them to stay off. I did a little research and there are some hackish? ways around this and I was wondering what the best method for my usecase would be.
edit: please see my comment below as it is not a problem with cancollide at all I think
Running a script on renderstep to set them to false. (worried about resources as there are about 100 of these dummies total)
Creating a collision group (not sure if this is the best way as the dummies are not required to move except for the knockback animation)
Working around this by not using humanoids at all or some other respawn method.
Here is the script I am using now:
local Figure = script.Parent
local Humanoid = Figure:WaitForChild("Humanoid")
local Respawn = Figure:Clone()
local anim = script.Animation
local animtrack = Humanoid:LoadAnimation(anim)
Humanoid.HealthChanged:Connect(function()
wait(0.1)
Figure.Head.face.Texture = "http://www.roblox.com/asset/?id=132894111"
animtrack:Play()
wait(0.3)
Figure.Head.face.Texture = "http://www.roblox.com/asset/?id=294435787"
end)
function onDied()
wait(1)
Figure:Destroy()
wait(5)
Respawn.Parent = game.Workspace
Respawn:MakeJoints()
end
Humanoid.Died:connect(onDied)