#Animator not working in build.

1 messages · Page 1 of 1 (latest)

tidal orchid
#

Hello,

I have setup a project with entities 1.0.0-pre.15 in Unity 2022.2.5f1.
In a sub scene I have a baked entity that spawn a game object prefab at runtime.

Outside of the sub scene I added the same prefab.
In editor, booth game objects are animated.
In Windows build, only the game object out of the sub scene is animated.
The other one is spawned but not animated.

I tried with both Mono and IL2CPP, with sub scene open/closed when building, sub scene included or excluded for the build settings.
Same results.

Does anyone have any idea what I'm missing??

#

also tried with and without entities.graphics..

tidal orchid
#

The issue seem to be that some animations works but others don't...

tidal orchid
#

tried various assets, from the asset store and mixamo. Same result. Some clip work fine, others don't. they all have the same import settings and all work both in editor and as game object in the built scene.

tidal orchid
#

bug reported IN-31623

rocky bridge
#

Are Animators even supported in Entity Scenes?
I was under the impression that monobehaviours didnt work properly in ECS Subscenes

tidal orchid
#

The animated game object is not in an entity scene, it is spawned at runtime by an entity.
And not all animation clip are affected. Some work, others don't.

#

On the left is the editor.
On the right is the windows built.

In each window, you can see 2 set of character.
The left one is the GameObject in the scene.
The right on is the GameObject spawned by the entity.

#

DOTS animation has been postponed to after the 1.0 final release. And the promise was that we would be able to bridge the missing feature thanks to GameObjects. If animation doesn't work or works erratically it's not going to be a good release for ECS...

quick sierra
tidal orchid
#

Thanks I updated the visibility

tidal orchid
#

I hope I'm wrong too but like I said I tried pretty much everything I could think of and nothing solves the issue.
I tried adding a delay before the spawn, disableling/enabaling the animator after spawn, various build configuration, with and without entites.graphics, different editor versions, check the logs for exception both in the build log an the player log.
I also checked that the same character spawned by a game object and not an entity/system worked correctly.

half belfry
#

where is this animator stuff referenced?

#

is it stored on a component on an entity before instantiation?

#

there's a known issues with unity object references being lost in subscenes

tidal orchid
#

The animator is on the prefab game object.
That prefab is bake on an entity in a class component.
Then at runtime I have a reactive system that instantiate the game object from the prefab.
It gets the animator from the instantiated prefab, and link it to the entity in another class component.

#

I don't think the issue is about reference since all animation are part of the same animator and only some are not played.

#

The character behaves as if the animator wasn't able to find some of the bones it needs to animate and simply default to a weird pose.

half belfry
#

it manifests in a bunch of different ways
for example a lot of us had similar issues where if you store a reference to say, an array of VisualTreeAsset on a component, the first one will load the second one will not

tidal orchid
#

I hope that's it but I don't have any errors in any logs, so it's hard to tell.

half belfry
#

i get no errors just missing assets

#

at the very least, there is something funky going on

quick sierra
#

was there any progress or confirmation on this?

Is there a workaround? We now have the same issue and it looks like i can happen at any point (previous builds worked)

sweet field
#

same problem here, with a simple companion system that instantiates gameobjects linked to entities

our animations are triggered via a condition by setting an integer variable on the animator, some animations work, some don't

no differences noted on our side when debugging the build or the editor

tidal orchid
half belfry
#

Not marked as fixed though

#

I can't see how 1.0 could release without it, at least netcode because it depends directly on this for its hybrid pipeline

sweet field
tidal orchid
#

The only known workaround that seems to work is to use addressable to load the animated game object. So instead of setting the prefab in a component, you set the adressable ID and the system taht spawns the animated game object will load it from adressable before instantiating it.

sweet field
#

I imagine perhaps putting the prefab in the Resources folder and loading it via path could work?