In my game I have a prefab with the tree. The script of this prefab contains static fields and static methods. This is done in order to be able to safely set at the level of any number of trees and get access to functions and all such other things. During the execution of the game, when you need to perform any action on the tree, I get an error: Code (CSharp): NullReferenceException: Object reference not set to an instance of an object . How can I directly in the code indicate which prefab I need and where its respawn point will be?
More info will be needed, but in general if you want to have access to one particular tree in the scene, static fields and methods are not what you are looking for. They are shared across all instances of the class.