Weird movement after animation is played

Hello, i am making a “super power” type thing in my game, but, after the animation is played, the character has weird movement, especially when rotating.

I’ve pinpointed the fact that it’s the animation’s fault, as when i run the same code, but the Animation:Play() line of code is commented out, i don’t get the offset.

How would i fix this?

Code
local ts = game:GetService("TweenService")
local deb = game:GetService("Debris")
local rs = game:GetService("RunService")

local db = false

script.Attack.OnServerEvent:Connect(function(plr)
	if plr.Character == script.Parent then
		if db == false then
			db = true
			--script.Parent.HumanoidRootPart.Anchored = true
			local anim = script.Parent.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.Animations.ShortRangeBeam)
			anim:Play()
			task.wait(1.15)
			local beam = game.ReplicatedStorage.AttackModels.ShortRangeBeam:Clone()
			beam.Parent = workspace.Attacks
			beam.Anchored = false
			local weld = Instance.new("Weld")
			weld.Part0 = script.Parent["Left Arm"]
			weld.Part1 = beam
			weld.C0 = script.Parent["Left Arm"].LeftGripAttachment.CFrame
			weld.C1 = beam.Attachment.CFrame
			weld.Parent = script.Parent["Left Arm"]
			deb:AddItem(weld,1.5)
			deb:AddItem(beam,1)
			beam.Touched:Connect(function() end)
			local dmgdeb = false
			local beamer = rs.Stepped:Connect(function()
				if dmgdeb == false then
					for _,h in pairs(beam:GetTouchingParts()) do
						if h.Parent and h.Parent:FindFirstChild("Humanoid") and h.Parent ~= script.Parent then
							dmgdeb = true
							h.Parent.Humanoid:TakeDamage(3)
							local bodypos = Instance.new("BodyPosition")
							bodypos.Position = beam.Position
							bodypos.P = 5000
							bodypos.MaxForce = Vector3.new(1,1,1)*250000
							bodypos.Parent = h.Parent.HumanoidRootPart
							game.Debris:AddItem(bodypos,0.15)
							h.Parent.Humanoid.PlatformStand = true
							delay(0.15,function()
								h.Parent.Humanoid.PlatformStand = false
							end)
							task.wait(0.1)
							dmgdeb = false
						end
					end
				end
			end)
			task.wait(0.5)
			beam.Anchored = true
			weld:Destroy()
			ts:Create(beam,TweenInfo.new(0.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out),{Size = Vector3.new(0,0,18),Transparency = 0.5}):Play()
			task.wait(0.25)
			script.Parent.HumanoidRootPart.Anchored = false
			beamer:Disconnect()
			task.wait(5)
			db = false
		end
	end
end)

All the parts in the beam need to be set to massless.

The parts in the beam are massless, and even then, it gets deleted after the attack is over, as you can see in the code.

Hmmm… that is strange are you sure there is nothing left on the Character after the attack happens?

I can’t find any parts, other than the actual rig’s parts

image

I have seen this problem before and judging by the AnimSaves you are using a Rig Builder rig. Try using a normal rig that just loads plainly. I think it may just be a problem with Rig Builder.

I tried it but to no avail, still same issue.

I tried looking at the code again to see if you moved the torso without moving the root part or vice versa but I did not find that. Unfortunately I can not assist you with this.

I “fixed” the issue by updating the animation to not jump backwards before the beam, now the weird movement doesn’t happen.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.