All objects are invisible after scene restart

I initialize the scene like normal, and after a certain event, the scene’s restart function is called, in that function all objects are removed from the scene, and then the scene’s init function is called again. The objects show up once the game initially starts, but then after it restarts all of the objects are invisible. I know the objects are really there because I tell them to print things when the objects do certain things like collide with each other and it works fine, it’s just that they’re all invisible.

Init function:

bool HelloWorld::init()
{

_scene = this;
GAME_SCENE = this;
//78. 201. 176

auto visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
PAWN = pawn::create();
PAWN->setName("Player");


GAME_GROUND = Ground::create();
HelloWorld::active = true;

this->schedule(HelloWorld::createRocket, 1, "create");

PAWN->setContentSize(Size(50, 50));
PAWN->setPosition(Vec2(Director::getInstance()->getWinSize().width/2, 150));


return true;
}

Restart function:

void HelloWorld::restart() {
this->removeAllChildrenWithCleanup(true);
this->unschedule("create");
HelloWorld::active = false;
this->init(); 

}

Note: I add the objects to the scene in the objects’ constructor variables. The things that are in all caps are macros for extern variables. I’ve checked to see if the objects were children of the scene by printed this->getChildByName(“Player”)->getName() in the init function and it printed “Player” each time.

I see only how you create objects but don’t see how you add to scene. How do you do this?

I add to the scene in the objects’ constructor functions.

I think I’ve figured it out by myself. I believe there’s something in the scene that I remove in the restart function and do not add back in the init function, and that thing is responsible for the rendering of the objects in some way, shape, or form. Maybe it’s a layer, or something else? Anyway, when I delete the player, and ground instead of removing all children from the scene it works!