Get a Reference or a pointer to Character Controller Component with ReflectType.

Hi everyone, I have a 3 entity in the scene, one for the Character Controller Component, other one for camera component and thrid one for Advanced Animation Component, each one with C++ classes, my question is, can get a reference or a pointer to Character controller component with ReflectType.

static void ReflectType(Schematyc::CTypeDesc<CHunterComponent>& desc)
desc.SetDescription("Component to Handle Animations for Main Player");
desc.AddMember(&CLord::m_pCharacterController, 'cc', "Character Controller", "character controller", "some description", nullptr);

Cry::DefaultComponents::CCharacterControllerComponent* m_pCharacterController {nullptr};

With this code the compiler tells me an error, "Type must be reflected, see TypeDesc.h for details!"

Re: Get a Reference or a pointer to Character Controller Component with ReflectType.

The message is most likely because of the "nullptr" used as the default value.

Other than that, you should not reflect Entity Components as properties of another Entity Component.
Each component should be added to an Entity. If your Entity Component requires another Entity Component, then get the instance during game start or whenever you need it using the IEntity::GetComponent<TYPE>() method.

Hope this helps
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 2 guests