BodyGyro Being cancelled out

  1. What do you want to achieve? Keep it simple and clear!
    Im trying to make a attack on titan game.
  2. What is the issue? Include screenshots/videos if possible!
    My BodyGyros stop working after one had been deleted
    Sorry for bad audio i had to compress the video
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I had tried to change the forces after one of the hooks had been unhooked, i had tried to change the names, I had also tried to make the loop controlling the cframe of the bodygyro turn on but none of those work like the bodygyro had straight up been disabled. I had tried to look for solutions but i haven’t found a topic specific enough.
		BodyGyro = Instance.new("BodyGyro",player.Character.HumanoidRootPart)
		while doit == true do
		task.wait()
		BodyGyro.CFrame = CFrame.lookAt(player.Character.HumanoidRootPart.Position, grab2.WorldPosition)
		--	CFrame.new(player.Character.HumanoidRootPart.Position,Result.Position)
		BodyGyro.MaxTorque = Vector3.new(1e+3,1e+3,1e+3)
		BodyGyro.D = 1250
		BodyGyro.P = 1e+5
		local radius = (grab2.WorldPosition - player.Character.HumanoidRootPart.Position).Magnitude
		local begin = rad / radius
		local strength = orginal / begin
		local magintude = math.clamp(strength,1000,30000)
		local magde = 2000
	
	--	print(rope.Magnitude)
		--print(rope)
		rope.Magnitude = magde
		--print(rope.Magnitude)
		--	print(begin)
			end
	end)
end)
game.ReplicatedStorage.DeHookEvent.OnServerEvent:Connect(function(player)
	doit = false
	BodyGyro:Destroy()
	if not player.Character.HumanoidRootPart:FindFirstChildOfClass("BodyGyro") then
		player.Character.Humanoid.PlatformStand = false
	else
        rightdoit = true
	end
	local tween = tweenservice:Create(grab2,tweeninfo,{WorldCFrame = grab1.WorldCFrame})
	local tween2 = tweenservice:Create(hook,tweeninfo,{CFrame = grab1.WorldCFrame})
	local tween3 = tweenservice:Create(beam,tweeninfo,{Coils = 8})
	tween:Play()
	tween2:Play()
	tween3:Play()
	tween.Completed:Connect(function()
		player.Character:SetAttribute("Hooking",nil)
		rope = nil
		grab1:Destroy()
		grab2:Destroy()
		beam:Destroy()
		hook:Destroy()
		local grab1 = nil
		local grab2 = nil
		local beam = nil
		local hook = nil
		local BodyGyro = nil
	end)
end)
1 Like

BodyGyro is deprecated and must be replaced with AlignPosition if you’re focusing on Positions and AlignOrientation if you’re focusing on Orientations :wink:

wym,
BodyGyro.CFrame = CFrame.lookAt(player.Character.HumanoidRootPart.Position, grab2.WorldPosition)

if i cant find a solution ill try that

1 Like

So if your BodyGyro isn’t being added then there’s a fault with your first function, either calling it or the variables involved.
Try some print statements to see what’s being fired and what isn’t.

@VSCPlays BodyGyro should still work though. Deprecated means they found a better system to replace it, but I doubt they’ll ever stop supporting it because so many older games use it.

i know, but the game might break soon…

thanks, I will like your post for that :slight_smile:

I tried that I think its just because its deprecated and probably not being updated because sometimes it works and sometimes it just cancels out I think i should just use AlignOrientation like @VSCPlays VSCPlays said if AlignOrientation works correctly ill say

yeah it would im guess because its not updated is the reason and it lacks functionality

1 Like

BodyGyro still works, and probably always will because so many places use it.
It hasn’t lost functionality.
Your game isn’t broken because you are using it.

1 Like

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