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

How do I stop this door from being removed from the game?

Asked by 6 years ago

So when I set the CanCollide to false and the transparency to 1 on a tycoon door I have, the tycoon door is removed from the game after maybe two seconds. When I don't the script runs fine. I really don't want the door removed from the game. Why is this happening and how can I fix it? Is it garbage collection maybe? I don't know. Anyway all I am doing is this:

script.Parent.CanCollide = false
script.Parent.Transparency = 1

No other code is the problem because I tested it without these to lines and it worked like a charm. Please help me out if you can. Thanks!

2 answers

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago
script.Parent.Anchored = true

it might be you not setting the Transparency back to 0, too.

0
Are you sayinig it was not anchored in the first place? User#21908 42 — 6y
0
You know what you might be right lol. User#21908 42 — 6y
0
I never checked about the anchoring User#21908 42 — 6y
0
You were right thank you so much! User#21908 42 — 6y
0
No problem :) Internal_1 344 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

If the door is not anchored then the problem is most likely that it's falling through the floor and being collected by the debris service. So, in a way, you could think of it as being "garbage collected" by ROBLOX's physics engine since it no longer has to compute collisions on the part, and it's not locked in place from being anchored.

A simple fix would be to anchor the part.

Answer this question