3
$\begingroup$

I am working on the cannon below:

enter image description here

It is going to be used in a Christmas mobile game and is going to shoot presents. I want to make it have an animation where, when I shoot the present, it's a kind of cartoon-like animation where the present goes through it visibly. I asked this question already a few days ago, and actually made the animation, and it turned out just how I imagined. But using the lattice modifier didn't seem to work, because it cannot be used in Unity. Also, Alembic files are not supported by Android, nor iOs. So I need a different method, without the lattice modifier, to do something like this:

enter image description here

What could be the Unity compatible tools to achieve this effect?

$\endgroup$
2
  • $\begingroup$ I am not on my personal PC so I don't have access to Unity but can you check if you can import .abc file to unity? Because it seems abc format supports lattice animation $\endgroup$
    – MikoCG
    Nov 23, 2021 at 10:01
  • $\begingroup$ Thank you but unfortunately I looked it up and seems like Android and iOs do not support .abc files. $\endgroup$ Nov 23, 2021 at 12:37

2 Answers 2

4
$\begingroup$

Not sure if this is going to work with unity (because i don't use it) But here is a way to get the keyframes.

1: Go to Edit > Preferences > Addons... and turn ON Import-Export New Tek MDD Format.

2: Select the Mesh that is getting the deformation from the Lattice, make a copy Shift + D, delete the Lattice from this copy and put it on a side.

3: Select the Original Mesh again and go to File > Export > Lightwave Point cache (Mdd), put the Start Frame and the End Frame.

4: Select the Copied Mesh and go to File > Import > Lightwave Point Cache (Mdd) and select the Mdd that you exported.

Now, the copy has keyframes

enter image description here

$\endgroup$
1
  • $\begingroup$ Wow, I tried it out and it worked both in Unity and on Android! Just the trick I was hoping for. Thank you so so much!!! $\endgroup$ Nov 29, 2021 at 8:48
2
$\begingroup$

Instead of a lattice, you could rig the cannon with a bunch of bones arranged in a row. How many is up to you... (More bones = smoother animation but heavier asset)

Then animate the scale of each bone up, then down, consecutively to achieve a similar effect to the one you get using a lattice.

There is an addon called Commotion that can automate the consecutive animation offset but that can also be done manually with a reasonable amount of effort.

Here is a bad-looking example but I hope it illustrates the point. (You'll probably want more overlap between the animation of the individual bones)

Alternatively, you may be able to create a similar effect in Unity. It could be an animated displacement shader for example. There may be other techniques. Ask about that in a community focused on Unity3D!

enter image description here

$\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.