I am using a 3rd party asset, Motion Matching for Unity, and it is a brilliant solution but for our use case it is giving significant performance issues. See the attached image where you can see Director.PrepareFrame
taking 9.33ms which is nearly half of the whole player loop.
In that you can see 14 calls to SetupControllerDataSet
, ranging of between 0.5-1.25ms each. We are running this on 30 characters at once and in this frame 14 of the characters decided to change animation. Is there a way this can be pushed to jobs or any other way to optimise this as much as possible. The problem is that this is an internal Unity process called when changing from one animation to another and we don’t have much control over it.