- Home /
Question by
koralturkk · Sep 23, 2020 at 08:28 AM ·
scripting problem
Application.isPlaying returning true when I exit play mode
public void OnDestroy()
{
// Something fishy going on here
if (Application.isPlaying == true)
{
InputManager.instance.RemoveWeapons(this);
}
}
When I stop playing in unity, the Application.isPlaying check does not avoid the incidence of an already removed InputManager due to stop playing to being called to remove again which causes null reference exception.
I would be glad if you can help me :):)
Comment