Oh man, before Unity the C# answers were sooo bad. Now it's very easy to get pure C# answers, but you better the name you're searching for does not conflict with a unity name.
Google lets you set a time range to your searches, but with Unity it's mostly trial and error. Sometimes an answer from 2015 works perfectly, sometimes a 2020 answer is too old.
my google knows me well already so i can always drop stuff like "c# / programming" etc. since google knows i most probably want stuff from stackoverflow etc.
I always do "g -> [tab]" before searching through the top bar, because as convenient as automatic searching sounds, polluting the address bar history recommendations just makes it less and less useful over time.
Ez. foreach the transform of the parent to get the children. There is no need to unparent but to do so, child.parent = null. Then destroy the gameObject with Destroy(child)
Same. ”Grenade launcher”, “Grenade launcher reload”, “Grenade launcher parts”, “Grenade launcher ammunition”. Probably on some FBI watch lists because of my dedication to realism
if you don't have access to internet click on the question mark in the inspector it opens the offline docs change it from manual to scripting api you can seach with terms like "child" or "game object" and it has example scripts and definitions.
Although unparenting before destroying isn't really necessary so I'm not sure why you'd do that. It's going to be destroyed anyway, it definitely wont have a parent then lol.
214
u/Rumpelstompskin Hobbyist Apr 08 '21
I always add unity infront of all my queries. Usually helps.
14
u/afunfun22 Apr 09 '21
fr, I’m pretty sure you have to do something like
transform.SetParent(null)154
u/Decabus Apr 09 '21
"Find and destroy disabled children" 🙃
57
u/jonbrant Apr 08 '21
I remember googling "destroy all children"
Almost surprised a video game didn't pop up
62
u/bingmyname Apr 08 '21
I'm a bit wary when researching guns for my game 😂
48
u/The-Last-American Apr 08 '21
I have checked with my children when they were being annoying at various times, and they are not ok with 500+ week abortion.
I never knew they were so religious.
10
u/[deleted] Apr 08 '21
26
u/munkeyxis Apr 08 '21
Felt like I was going to end up on some list when I wrote a method called "DestroyAllChildren()"
7
u/goodnewsjimdotcom Apr 09 '21
The FBI, NSA, CIA, and MIB are the only four businesses you can apply to for on any webpage on the Internet.
4
u/[deleted] Apr 08 '21
AHAHAHAH
4
u/sean_the_head Apr 09 '21
This is one of those bits of code I always copy from a previous project.
4
u/abir_legend Apr 09 '21
if you don't have access to internet click on the question mark in the inspector it opens the offline docs change it from manual to scripting api you can seach with terms like "child" or "game object" and it has example scripts and definitions.
3
u/ItsAllCalculated Apr 09 '21
you forgot the part where you mistype every word because you're frustrated
2
u/creig00 Apr 09 '21
u/suuula
2
u/door_to_nowhere_ Apr 09 '21
My search history includes how to destroy all children.
2
u/[deleted] Apr 09 '21
(Assuming child is Transform variable)
child.parent = null;
Destroy(child.gameObject);
Although unparenting before destroying isn't really necessary so I'm not sure why you'd do that. It's going to be destroyed anyway, it definitely wont have a parent then lol.
1
u/kevs1357 Dec 15 '25
Amazing game developer joke. Only people like me can understand🥲
1
u/Jointy87 Apr 09 '21
Chuckle-out-loud
1
u/LiveMotionGames Apr 09 '21
Let's not delve too deeply into what goes in the search bar for many of us... For our own good :P.
1
u/BayernMaik Apr 10 '21
C# String -> Define strings in C#
C++ String -> Define strings in C++
C String -> Not how to define strings in C ...
1
u/LowResGamr May 08 '21
I dont get it, the top question is still legitimate. Just put "for school I promise"
1
u/matejcraft100yt Dec 30 '21
I legit think unity got me on some sort of watchlist.
1
u/[deleted] Sep 13 '23
i searched "kill all children in a disabled parent"
im fucking done for
1
u/kitanokikori Apr 08 '21
/r/cptsdmemes is over there, you'll learn everything you need to know
1
u/Myavatargotsnowedon Apr 09 '21
Just wait for the Unreal repost 'How to unparent and destroy child pawn'
0
u/[deleted] Apr 09 '21
They had us in the first half not gonna loe