I usually follow the game design pattern of having an AI Controller and a Pawn, each implemented as separate GameObjects.
In this setup, all AI logic and behavior logic are inside the Controller rather than the Pawn.
However, with the current FollowerEntity, moving the Pawn transform requires the component to be attached directly to the Pawn GameObject.
It would be much more flexible if there were an option to specify the Sync Transform target, rather than having it hardcoded to the GameObject the component is attached to.
I wouldn’t call this an “edge case” but I would think of it as a pretty rare scenario. I think it’s solved rather well by having another GameObject that mimics the transform of the FollowerEntity’s GameObject. Maybe I’m missing something crucial to this suggestion? Interested in hearing back on what you think here.
I wouldn’t call it an edge case, but I do think it would be a fairly rare scenario.
My main concern with using another GameObject to mimic the FollowerEntity transform is performance. That approach would require updating those objects in a separate Update loop, whereas FollowerEntity movement is handled through the job system. In a small-scale setup that might be acceptable, but for an MMORPG use case it becomes much more important to avoid adding extra per-object update overhead.
In my case, decoupling is essential because I only want to expose visuals to the client, while keeping the simulation side separated as much as possible. Because of that, a solution that depends on additional GameObjects constantly mirroring transforms feels like it would work against the scalability benefits that FollowerEntity is meant to provide.
That said, I’d be interested to hear whether there’s a way to achieve that without losing the performance advantages of the job-based approach.
This is where we start to get into the ECS based stuff that I am absolutely horrible at, just from lack of any serious exposure. I’ll have to tag Aron on this one to get you some more actionable advice on this, but I think this is where you’d want to get more into the ECS stuff that FollowerEntity can do? I’m not sure what your specific needs are for your game though.
The pawn system is something common in other game engines, but I would say that in Unity it’s typically not used. To avoid complexity, this is not supported with the FollowerEntity.
You can, however, make it move independently of the transform, and then sync transform.position = ai.position every frame as you wish (even though this is slightly slower than the built-in way).