Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
pwnd64 106
8 years ago

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.

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. Conmmander 479 — 8y

1 answer

Log in to vote
1
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

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

game:GetService('Debris'):AddItem(Gyro, 1)
0
hm, that would be weird as it hasnt happened before, but ill try it thanks pwnd64 106 — 8y
0
damn, that didnt fix it. thanks for trying pwnd64 106 — 8y
Ad

Answer this question