How do you check if the "GameObject" variable is a prefab or an actual game object?

A Prefab is a game object. A GameObject that was instantiated from a prefab is also a game object.

I would like to know of some ways to check to see if the game object is a “prefab” or an “instantiated game object”?

Why Prefab game objects don’t have a class of its own called “PrefabObject” for prefabs, is something I’m wondering about.

Huu? Please explain a scenario when you would need to know the difference.

Check for the word “Clone” in the gameObject.name?

Unity Multiplayer, where you need a game object to check for player authority. If you happen to pass in a reference to a prefab, everything breaks down. It’s even more obvious if your partner has no idea you are mixing prefabs and game objects up together in the Inspector. Some errors are more obvious to fix than others, and I have tried my best to avoid the obvious ones.

Every object in the scene all have “(Clone)” at the end. I am making a simple RTS, so all units are spawned in with “(Clone)” the moment the players are connected.

Which is exactly what you asked for :slight_smile: I think you might need to clarify. It sounds like whatever you’re doing, you’re just doing it “wrong”. Are you talking about being able to check individuality of GameObjects? i.e. via a GUID or whatnot?

I am unable to check individually of all GameObjects if they are prefabs or game objects, even with GUID or something else for identification.