vivienneanthony
Hello
Does the line below makes since ? The GameObject is a general name that I will change.
[Wed Dec 17 17:58:06 2014] ERROR: Could not create unknown component type 1B71
The code that is causing the problem is
/// Loop through the whole scene and get the root Node
Node * RootNode = scene_ -> GetParent();
/// Get node list
PODVector <Node *> NodesVector;
scene_ -> GetChildren (NodesVector, true);
/// Set necessary objects
Node * OrphanNode;
String Nodename;
/// loop nodes
for(int i=0; i < NodesVector.Size(); i++)
{
/// Do nothing like copy the node vector to a node
OrphanNode = NodesVector[i];
/// Add a component
GameObject * OrphanNodeGameObject = OrphanNode-> CreateComponent<GameObject>();
OrphanNodeGameObject -> SetLifetime(-1);
}
The header file is
#ifndef GAMEOBJECT_H_INCLUDED
#define GAMEOBJECT_H_INCLUDED
#include "LogicComponent.h"
using namespace Urho3D;
/// Character component, responsible for physical movement according to controls, as well as animation.
class GameObject : public LogicComponent
{
OBJECT(GameObject)
public:
/// Construct.
GameObject (Context* context);
/// Register object factory and attributes.
static void RegisterObject(Context* context);
/// Handle startup. Called by LogicComponent base class.
virtual void Start();
/// Handle physics world update. Called by LogicComponent base class.
virtual void FixedUpdate(float timeStep);
/// updatelifetime
float GetLifetime(void);
void SetLifetime(float lifetime);
private:
/// Component information
float GameObjectLifetime;
};
#endif // GAMEOBJECT_H_INCLUDED