#How to sync a Transform from ECS to GameObject?

1 messages · Page 1 of 1 (latest)

soft ferry
#

Does anyone know how to sync a GameObject Transform with an ECS Transform?

I want to make animated enemy characters and ECS has no animations, so I need to sync the CharacterController Position/Rotation from the ECS Entity to the corresponding GameObject.
There is an example in the CharacterController Sample, but it's for a singleton (MainCamera sync).

I think there should be an easy way to do this but all info on this topic seems to be outdated and no longer working.

So how can I keep a reference to a GameObject in my Entity and write its position/rotation at the correct Time so there is no visible Lag?

soft ferry
#

Seems like Mesh Skinning is in Experimental Support now.

Will see if I can get it running, ragdolls don't just convert, it seems.

gleaming rock
#

You can do a few things here:
You can make a hybrid approach like you are suggesting, which should just work like just the normal unity workflow, you just lose the performance gain from DOTS, I think the examples from Unity here would suffice: https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/PhysicsSamples/README.md (ragdoll image is from this) Hybrid is pretty well explained in the docs/examples.
For animation specifically, you can get Rukhanka from the asset store, that's like 'Mechanim' but for DOTS: https://assetstore.unity.com/packages/tools/animation/rukhanka-ecs-animation-system-241472
Personally I use the GPU baker from the store https://assetstore.unity.com/packages/tools/animation/gpu-ecs-animation-baker-250425 but vertex animations have huge caveats, but it is the most performant.
And perhaps other people know anything else, but these are what I know.