I want to set up a system such that I can reference the LocalTransform on one entity from a component on another entity. In this particular case, I want to control the rotation of the turret cap on a turret via a reference to its transform. I tried using a RefRW for it, but ECS complains about serializing pointers, which makes complete sense, but is also quite annoying because a pointer is practically exactly what I want
#Referencing a component on one entity from a component in another
1 messages · Page 1 of 1 (latest)
basically my question is, is there an alternative that could work just as well?
like I know that LinkedEntityGroups are a thing that are implemented as buffers iirc. Is there a way I can navigate the list of linked entities manually and get the data I need that way? Something along those lines?
the reference will always be a child of the base, so that would potentially work if it's possible to navigate the linke entity group and get useful information from it
ok so after more research, I figured out that I can navigate it to a degree, but I still need to access the components present on the entity, and I have yet to see a way to do that
ok apparently I'm just dumb and have never seen the GetComponent or HasComponent functions