SetActiveRecursively freezes game

Hello Forums!

I have 3 objects that are enabled and disabled through gameobject.SetActiveRecursively. However, whenever I do change, the game freezes briefly, even in an almost empty scene with:

1000x1000 Terrain
Camera
3 Cubes that are activated and deactivated with the script
Directional Light

Does anyone know how to fix this? Its really annoying!

Thanks in Advance:smile:

code?

Sorry!

This is the update function:

if (Input.GetMouseButtonDown (0) ) {

//gun is a gameobject

gun.SetActiveRecursively (true);

}