I have a script that teleports a player from one teleport part to the other when one of them is touched. When the player is teleported, the player looks normal on the client side, but the character is permanently tilted forward on the server side. The more I use the teleport pad, the more tilted the character looks on the server. Is there an explanation to this weird behaviour?
Edit: I found out that the problem occurs with the character’s running animation. The running animation makes the torso tilt forward slightly, and when the player is teleported while the running animation is playing, the server thinks that the torso is permanently tilted forward. How can i prevent this from happening without making the animation not affect the torso?
Vent 1 and Vent 2 just refer to the teleport pads, you can ignore sus-o-meter that does not affect the problem
local debouncetable = {}
script.Parent.Vent1.Vent1.Touched:Connect(function(otherpart)
if otherpart.Parent:FindFirstChildWhichIsA("Humanoid") and otherpart.Parent.Humanoid.Health > 0 and game:GetService("Players"):GetPlayerFromCharacter(otherpart.Parent) then
if debouncetable[otherpart.Parent] == true then return end
debouncetable[otherpart.Parent] = true
otherpart.Parent.HumanoidRootPart.Position = script.Parent.Vent2.Vent2.Position + Vector3.new(0, 2.5, 0)
script.Parent.Vent2.Vent2.VentSound:Play()
otherpart.Parent["Sus-o-meter"].Value += 4
if otherpart.Parent["Sus-o-meter"].Value >= 10 then
game:GetService("ReplicatedStorage").Events.AmogusAnimation:FireClient(game:GetService("Players"):GetPlayerFromCharacter(otherpart.Parent))
end
task.wait(2)
debouncetable[otherpart.Parent] = nil
end
end)
script.Parent.Vent2.Vent2.Touched:Connect(function(otherpart)
if otherpart.Parent:FindFirstChildWhichIsA("Humanoid") and otherpart.Parent.Humanoid.Health > 0 and game:GetService("Players"):GetPlayerFromCharacter(otherpart.Parent) then
if debouncetable[otherpart.Parent] == true then return end
debouncetable[otherpart.Parent] = true
otherpart.Parent.HumanoidRootPart.Position = script.Parent.Vent1.Vent1.Position + Vector3.new(0, 2.5, 0)
script.Parent.Vent1.Vent1.VentSound:Play()
otherpart.Parent["Sus-o-meter"].Value += 4
if otherpart.Parent["Sus-o-meter"].Value >= 10 then
game:GetService("ReplicatedStorage").Events.AmogusAnimation:FireClient(game:GetService("Players"):GetPlayerFromCharacter(otherpart.Parent))
end
task.wait(2)
debouncetable[otherpart.Parent] = nil
end
end)
Yeah pretty much, but because your character is rotating for some reason, calling CFame in this instance makes sure the character isn’t rotating. I could not tell you why your character’s rotating with .Position though because I can’t access my computer to test it right now
Simply, most of your cases should be using CFrame and not Position.