Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

BodyGyro won't delete itself in game, but will in studio? [Solved]

In this script, I'm creating a bodygyro to fix a flipped car. In studio, it works fine, but in game the gyro doesn't delete itself.

I've tried :Destroy(), game.Debris:Additem(), and setting the gyro's stats to 0.

local Gyro = Instance.new("BodyGyro",Car.VehicleSeat)

Gyro.MaxTorque = Vector3.new(9999999,0,0)

Gyro.D = 500

Gyro.P = 3000

wait(1)

game.Debris:AddItem(Gyro,1)

Any help would be appreciated.

EDIT:

I think I found the issue. With a wait() in between spawning and deleting the gyro, it never got deleted for some reason. Deleting that fixed it.

1 comment

0

If this is solved then accept Pyrondon's answer just because or delete the question. Stop chaning the name to [Solved] It does nothing.

1 answer

Perhaps the game hasn't registered Debris as a service? Try changing line 9 to:

game:GetService('Debris'):AddItem(Gyro, 1)

2 comments

0

hm, that would be weird as it hasnt happened before, but ill try it thanks

0

damn, that didnt fix it. thanks for trying

This discussion is preserved as it was. New answers, comments, and votes are closed.