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\$
2
  • \$\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
    Commented Jan 30, 2020 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
    Commented Jan 30, 2020 at 11:38

2 Answers 2

1
\$\begingroup\$

Update: There is now an animation package for DOTS which might work better than what is described in this answer, but is still considered highly experimental.

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\$
0
\$\begingroup\$

The DOTS Animation package is no longer usable and the next release isn't planed for quite some time. We have to go back to the Hybrid approach.

Here is a tutorial series that covers 1.0 and it's latest episode covers hybrid animation.

\$\endgroup\$
2
  • \$\begingroup\$ This is currently a link-only answer. These are prone to information rot, and so our usual policy is to convert them to comments. To make this post stand on its own as an Answer, it should include at least a brief summary of the information you hope a reader will glean from this video link — that way it's useful even if the video becomes inaccessible. This also helps attract up-votes, since users can quickly scan the text to assess the quality of the advice without committing to watch a whole YouTube series. \$\endgroup\$
    – DMGregory
    Commented Nov 3, 2022 at 17:35
  • \$\begingroup\$ While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review \$\endgroup\$
    – liggiorgio
    Commented Nov 3, 2022 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .