How can I remove all of the components on a gameObject through scripting?
1 Answer
1var components = GetComponents(Component);
for (component in components) {
if (typeof(component) != Transform) {
Destroy(component);
}
}
How can I remove all of the components on a gameObject through scripting?
var components = GetComponents(Component);
for (component in components) {
if (typeof(component) != Transform) {
Destroy(component);
}
}
Thanks!
– anon36094622