Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Parent Child Entity Relation #18

Open
TheEmperorE2 opened this issue Jan 2, 2025 · 1 comment
Open

[FEATURE REQUEST] Parent Child Entity Relation #18

TheEmperorE2 opened this issue Jan 2, 2025 · 1 comment
Assignees

Comments

@TheEmperorE2
Copy link

Hi there. In future if you have time for this. I think this feature is very handy.

If want to make ex.: Entity "Character" with multiple sprites moved by parent.

@dwjclark11
Copy link
Owner

@TheEmperorE2 Hello, this is something that we are definitely going to be doing shortly.
We will be creating a new component called Relationship and all entities will have this for the Entity class by default.
It will be something like this:

namespace SCION_CORE::ECS
{
	struct Relationship
	{
		std::size_t numChildren{ 0 }; // Optional
		entt::entity firstChild{ entt::null };
		entt::entity prevSibling{ entt::null };
		entt::entity nextSibling{ entt::null };
		entt::entity parent{ entt::null };
	};
}

Then we will need to also add a local position to the transform component. Because we will need that to offset the child from the parent position.

@dwjclark11 dwjclark11 self-assigned this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants