What happens to created objects that are created with Instance.new() or :Clone(), but are never parented using the .Parent argument?
Questions & Theories
I’m interested to know what happens if for example, I clone a Part, and set its .Position and .Size, but never actually Parent the part.
Can I still cast rays from the .Position of the Part, even though its .Parent isn’t ever being set to anything, and not have to worry about using :Destroy() to later remove the Part in order to stop a memory leak from the buildup of parts?
Could this even slightly boost performance, and is it better than simply setting a Part’s .Transparency to 1 in order to never render it, and then using :Destroy() on it?
According to Roblox, setting a Part’s .Parent to nil causes it to be “temporarily removed”, what does that mean?
I do believe this is the same when you use Instance.new() as well, and you can manage change its properties but I don’t believe you can actually use it with other scripts (Unless if you call WaitForChild())
I believe it’s just a placeholder for it, not sure though
Let’s say I want to grab the Part’s .Position for the [origin] argument that’s needed for raycasting. Would it boost performance if I never set the .Parent, but just used the Part to grab the .Position?
I am not sure if that will even work or not, it might. But why can’t you just have a vector3 value if you only wanted the position? Instancing a part is pretty expensive