Hi guys,
What is the recommended way of loading prefabs? I have a simple prefab containing AnimatedModel, RigidBody and AnimationController. I am trying to assign it to a player class. Ideally I would like to access the prefab inside the player class by initiating it inside the init function and using the update function to move it around. At the moment I am loading it like this:
[code] Urho3D::WeakPtr
Urho3D::Node
playerNode = _scene->CreateChild(“Player”);
Player* player = playerNode->CreateComponent();
player->Init();
player->SubscribeToEvents();
XMLFile *sceneFile = cache->GetResource(“Prefabs/player.xml”);
playerNode->LoadXML(sceneFile->GetRoot());[/code]