Jump to content

Recommended Posts

Posted

I'm trying to make a Level of detail system, and i found that I can not hide children from a parent. I would like to suggest the ability to hide a child Ie: child:Hide() This would hide the child and leave the childs' children with the same properties (i hide a child and it's children is still visible.). Also the ability to hide all of a childs children ie: child:Hide(True). This would hide a child and all it's children, but leave its' parents alone.

 

 

My experiments with children

 

Attach this to the parent:

function Script:Start()
self.entity:Hide()
rotation = Vec3(0,0,45)
print(self.entity:CountChildren())

local child = self.entity:GetChild(0)
print(child:CountChildren())
print(child:GetPosition():ToString())

local child1  = child:GetChild(0)
print(child1:CountChildren())
print(child1:GetPosition():ToString())

child1:SetRotation(rotation) -- to check if we are actually manipulating the child of a child

child1:Hide() -- the rotated csg should diassapear
end

 

Results:

LaGWQ5y.png

Posted

i found that I can not hide children from a parent.

 

you are supposed to be able to hide children and hide the parent + children.

 

EDIT3 --yeah its strange whats happening because it looks like the hierarchy is being broken, but the problem is being caused by the csg brushes being optimized into a singular mesh. If memory serves, you can fix that by either adding a mass to each csg brush or an empty script and then it wont happen.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...