I’m trying to make the player face the direction they’re blocking in and it works, but the output spams “The Parent property of lookGyro is locked, current parent: NULL, new parent HumanoidRootPart”. I’ve tried to parent the gyro to nil instead of destroying it, but it stays in the root-part and the character is stuck facing one direction. I could be dumb and be overlooking something but I don’t know.
video -
https://gyazo.com/917fc253d92fbf9ae7d15cec6580063b
uis.InputBegan:Connect(function(input)
if not on then return end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
lookGyro = Instance.new("BodyGyro")
lookGyro.Name = "lookGyro"
lookGyro.MaxTorque = Vector3.new(1,1,0) * 100000
lookGyro.D = 100
blocking:Play()
tool.emitter.Inner.Trail.Enabled = true
if blocking.IsPlaying then
local function renderstep(dt)
lookGyro.Parent = root
lookGyro.CFrame = CFrame.new(root.CFrame.Position, root.CFrame.Position + Vector3.new(camera.CFrame.LookVector.X, 0, camera.CFrame.LookVector.Z))
humanoid.AutoRotate = false
wait()
end
humanoid.WalkSpeed = 10
runService.RenderStepped:Connect(renderstep)
end
wait(0.3)
tool.emitter.Inner.Trail.Enabled = false
end
end)
uis.InputEnded:Connect(function(input)
if not on then return end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
humanoid.WalkSpeed = 16
lookGyro:Destroy()
blocking:Stop()
humanoid.AutoRotate = true
end
end) ```