Quantcast
Viewing all articles
Browse latest Browse all 713

How to determine if a game object is a generated prefab using code

I am trying to add a script to all game objects in a scene. I have gameobjects created in unity and gameobjects imported from 3d model software. The ones imported from a 3d model software makes the console get mad and say "You cant add script to this gameobject because its a generated prefab and can only be modified through an AssetPostProcessor" How can I make code to check if the gameobject is a generated prefab at runtime?

Viewing all articles
Browse latest Browse all 713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>