Forgive me my newbness, I know not what to do.
I’ve read the answers and documentation on calling a function from another script without monobehavior and I can do that. My problem is one level more complex than that. I’m hoping you can help.
I have a little cube that floats across a plane, spawning one of six object prefabs. The actions (movement, and 1-6 number keys which correspond to the object to be spawned) are controlled by the script “Player1”. I also have a script called “SpawnUnit”. This script is fed three values by “Player1” which determine the type of object to be instantiated. The “SpawnUnit” script is not attached to an object.
Briefly, the problem I’m running into is that if I remove monobehavior from the SpawnUnit script, I can call that script from Player1, but if I remove monobehavior from SpawnUnit the spawn function can’t call “Instantiate”.
How do I call a function in a different script, without using monobehavior for the called script, when I need monobehavior in the script in order for that script to use instantiate?
Thanks for the help!