Jump to content

LxrdKxnny

Members
  • Posts

    3
  • Joined

  • Last visited

LxrdKxnny's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

1

Reputation

  1. I'm not sure why but adding the file manually didn't work, but creating the component from the editor instead did work. Thank you so much!
  2. I added the changes but it still doesn't seem to have fixed the issue. I'm unsure why this isn't working to be honest. I don't think there's anything else I've missed unless the folder structure I am using is incorrect:
  3. Hello there, I have followed the official documentation for creating components and getting them to display in the editor but I still can't see the component in the editor. I've created the component under 'Components/Character/CharacterMovement.hpp' and I have also added a 'CharacterMovement.json' file alongside it. I have also registered the component in 'ComponentSystem.h' but the component still won't show in the editor: #pragma once #include "UltraEngine.h" #include "Components/Character/CharacterMovement.hpp" using namespace UltraEngine; inline void RegisterComponents() { RegisterComponent<CharacterMovement>(); } Here is 'CharacterMovement.hpp' file: #pragma once #include "UltraEngine.h" using namespace UltraEngine; class CharacterMovement : public Component { public: CharacterMovement() { name = "CharacterMovement"; } void Update() override { // ... } bool Load(table& properties, shared_ptr<Stream> binstream, shared_ptr<Map> scene, const LoadFlags flags) override { if (properties["m_WalkSpeed"].is_number()) { m_WalkSpeed = properties["m_WalkSpeed"]; } if (properties["m_SprintSpeed"].is_number()) { m_SprintSpeed = properties["m_SprintSpeed"]; } return true; } bool Save(table& properties, shared_ptr<Stream> binstream, shared_ptr<Map> scene, const SaveFlags flags) override { properties["m_WalkSpeed"] = m_WalkSpeed; properties["m_SprintSpeed"] = m_SprintSpeed; return true; } std::shared_ptr<Component> Copy() override { return std::make_shared<CharacterMovement>(*this); } public: int m_WalkSpeed = 5.0f; int m_SprintSpeed = 10.0f; }; Here is the 'CharacterMovement.json' file: { "component": { "properties": [ { "name": "m_WalkSpeed", "label": "Walk Speed", "value": "5" }, { "name": "m_SprintSpeed", "label": "Sprint Speed", "value": "10" } ] } } I'm not sure what's happening here but if someone knows, I'd really appreciate the help!
×
×
  • Create New...