Hey guys,
i want to know if There’s a way to add different components with a Method. For Example in my game i am trying to attack enemys and only if a certain key is pressed i want the “Attacker” to appear. Turning off the Renderer wont work behause that just makes it invisble but collision would still be detected. So how can i do that?
GameObject.AddComponent< // Whatever component you want >() as // Whatever component you want;