Hi guys,
I have this Line of code
scripts.GetComponent("Spawning").canSpawn = true;
And it giving this error ‘canSpawn’ is not a member of ‘UnityEngine.Component’.
Hi guys,
I have this Line of code
scripts.GetComponent("Spawning").canSpawn = true;
And it giving this error ‘canSpawn’ is not a member of ‘UnityEngine.Component’.
Answered a bazillion times already. Use the generic version of GetComponent. In C#:
scripts.GetComponent<Spawning>().canSpawn = true;