289 reputation
211
bio website
location
age
visits member for 2 years, 5 months
seen Dec 4 at 16:03

Jun
16
comment Unity - Avoid using Find method by caching UnityObjects - Code review
But the class itself has the code to self destruct and remove the game object. Do I have to check whether this is the original object and not a clone then. Can't the original object be deactivated in some way so it doesn't have to exist in the game world and only the instantiated clones exist?
Jun
16
comment Unity - Avoid using Find method by caching UnityObjects - Code review
If one of those objects called GameObject.Destroy(this.gameObject); in their original code. How could I make sure that further instances could be created? See my edit.
Jun
16
revised Unity - Avoid using Find method by caching UnityObjects - Code review
added 698 characters in body
Jun
16
comment Unity - Avoid using Find method by caching UnityObjects - Code review
I like the idea of single instance classes taking care of themselves, thank you. As for instantiating objects from a cache, is comparing the type T with GetType a bit icky?
Jun
16
asked Unity - Avoid using Find method by caching UnityObjects - Code review
Apr
11
awarded  Popular Question
Jan
21
awarded  Yearling
Jan
12
accepted Trying to access another class that is outside my Unity script but casting is failing
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
So 'camera' is a protected name.
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
I'm still getting a warning that I am hiding an inherited member 'UnityEngine.Component.camera' if I go with this approach though.
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
Ah, I see. That's what has been confusing me. Thank you.
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
Debug.Log(GetComponent(typeof(FlyThroughCamera))) returns null
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
I have added a screenshot as requested.
Jan
12
revised Trying to access another class that is outside my Unity script but casting is failing
added 89 characters in body
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
GetComponent still returns null, even though the class exists and is linked via the Inspector window.
Jan
12
comment Trying to access another class that is outside my Unity script but casting is failing
I have added the FlyThroughCamera on my GameObject in the inspector but the cast will revert it to null. If I delete the cast code then I will get a warning about hiding inherited members because it is not instantiated in any way.
Jan
12
asked Trying to access another class that is outside my Unity script but casting is failing
Jan
11
accepted My method for switching between cameras in Unity does not change the main camera
Jan
11
comment My method for switching between cameras in Unity does not change the main camera
Good thinking. How would I find all cameras in the scene regardless of their activity?
Jan
11
asked My method for switching between cameras in Unity does not change the main camera