burgelkat Posted April 24, 2017 Share Posted April 24, 2017 Hello, i have a question about show and hide: If i Hide an Object by this script function Script:Show()--in if (self.entity:Hidden()) then self.entity:Show() end end function Script:Hide()--in if not self.entity:Hidden() then self.entity:Hide() end end then child are hide too. But if i have an Object that is at "Start" hidden. Then the Childs ( the hole object) not show after i would show it . What i have to do that all Childs are show so i have not to put in every child a script with show ? (the Childs are different Boxes and 2 ermitters) i hope you can follow what i have written Quote Link to comment Share on other sites More sharing options...
Crazycarpet Posted April 24, 2017 Share Posted April 24, 2017 Sorry, I'm not quite sure I follow but are you trying to make Show/Hide execute on all children? It would look something like this: function Script:Show() if self.entity:Hidden() then self.entity:Show() end -- Show all children. for i = 0, self.entity:CountChildren() - 1 do local child = self.entity:GetChild(i) if child:Hidden() then child:Show() end end end function Script:Hide() if not self.entity:Hidden() then self.entity:Hide() end -- Hide all children. for i = 0, self.entity:CountChildren() - 1 do local child = self.entity:GetChild(i) if not child:Hidden() then child:Hide() end end end I feel like LE does this implicitly though... shouldn't be necessary. Quote Link to comment Share on other sites More sharing options...
burgelkat Posted April 24, 2017 Author Share Posted April 24, 2017 ah ok at the moment i tryed to do the same but with no luck will try your version.. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Crazycarpet Posted April 24, 2017 Share Posted April 24, 2017 ah ok at the moment i tryed to do the same but with no luck will try your version.. Thanks a lot. Yeah, well wish I could help more because that code isn't necessary. Just tested and I was right, LE hides/shows the children implicitly. If you're referring to the "hidden" checkbox in the scene panel when you say "start as hidden" I don't think Show() will work to show it again. I'm not sure if it's a bug but it hasn't worked for quite a while. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 24, 2017 Share Posted April 24, 2017 This is the way it is meant to work. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
burgelkat Posted May 29, 2017 Author Share Posted May 29, 2017 Sorry for a new question about this. the script function good but not with a character model if i hide a character for example the merc with m4 and i will show the char at a Special Moment then the m4 is always hidden. Wy the child m4 does not show up? Is a char model with many bones as child a different child that has to be another script code ? Thanks for your help ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.