0
\$\begingroup\$

I'm working on isometric game in 2D but didn't find any good tutorial in how to handle animation...any help?

\$\endgroup\$
  • \$\begingroup\$ As far as I am aware, the machinima animation system isn't ported to DOTS yet. So you will have to program your own animation system. \$\endgroup\$ – Philipp Jan 30 '20 at 11:34
  • \$\begingroup\$ Oh, and doing some further research, it also appears that the DOTS doesn't have an equivalent to SpriteRenderer yet. How did you solve that problem? \$\endgroup\$ – Philipp Jan 30 '20 at 11:38
1
\$\begingroup\$

As far as I am aware, the machinima animation system with its convenient visual state machines and animation timelines isn't ported to DOTS yet. So you will have to program your own. My approach would be as follows:

  1. Create a new shared component Animation which refrences the meshes used for all the different animation frames of an animated asset.

  2. Create instances of that shared component - one for each asset you want to animate.

  3. Assign those shared Animation component instances to any entities you want to animate.

  4. Create a new system AnimationSystem which queries all entities with Animation, Unity.Rendering.RenderMesh and any components which are relevant for determining what frame to display (Maybe Unity.Transforms.Rotation to determine the direction it faces? Maybe Unity.Physics.MotionVelocity to determine if it's running or standing? Maybe a component of your own which handles the current state of your entity?).

  5. Implement the system to use the data from the components to determine which frame to display, retrieve the mesh for that frame from the Animation component and apply it to the RenderMesh.mesh of the entity.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.