I am trying to make a death animation and on my screen it looks fine but on other players screens I flop around. The given script is a LocalScript in StarterCharacterScripts.
I have tried anchoring the player on the server and It didn’t make a difference. I have also tried putting a BodyGyro in the HumanoidRootPart with all of it’s MaxTorque vectors set to 0 as well as trying to animate it without anchoring the HumanoidRootPart. I have tested this in-game and in studio.
On the server, it looks the same as Player2 in the video.
I have a Humanoid in StarterPlayer with BreakJointsOnDeath set to false.
The gray screen effect you see is apart of another script, don’t pay any mind.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")
local earRinging = script:WaitForChild("EarRinging")
local animID = script:WaitForChild("fallAnim")
local player = game.Players.LocalPlayer
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local Anim = humanoid:LoadAnimation(animID)
local cam = workspace.CurrentCamera
local remoteEvent = ReplicatedStorage:WaitForChild("deathAnim")
local optionalRedScreen = true
local dead = false
local camInfo = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local redInfo = TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
function setCollisionGroup(fCharacter, groupName)
for i, v in pairs(fCharacter:GetDescendants()) do
if v:IsA("BasePart") then
v.CollisionGroup = "deathFallOver"
end
end
end
function onHealthChanged(health)
if health <= 0 and not dead then
dead = true
local redTintEffect = Lighting:WaitForChild("RedTintEffect")
local cameraTween = TweenService:Create(cam, camInfo, {FieldOfView = 120})
local redTween = TweenService:Create(redTintEffect, redInfo, {TintColor = Color3.fromRGB(255, 0, 4)})
character.HumanoidRootPart.Anchored = true
setCollisionGroup(character, "deathFallOver")
if optionalRedScreen then
redTween:Play()
end
earRinging:Play()
Anim:Play()
cameraTween:Play()
task.wait(Anim.Length - 0.3)
cameraTween:Cancel()
redTween:Cancel()
character.HumanoidRootPart.Anchored = false
setCollisionGroup(character, "Default")
earRinging:Stop()
remoteEvent:FireServer(player)
end
end
humanoid.HealthChanged:Connect(onHealthChanged)
The RemoteEvent used in the script Loads the players character on the server and deathFallOver has Default to false on CollisionGroups.