Best way for hook chain animation in any simple way for sprite

i use scale for x-axe - but its not good

How make it better - i dont want resize chain. Need simple animation way. And yes - i have full chain img 2800 px length

i want this result

It looks good. What makes you unsatisfied?

this

I’d like to see whole chain links

This is a Panthera-related question. Please do not remove it from the subject so that people who use Panthera may assist you

No - its not Panthera-related question - i use this only for animation preview

Then you can use model and repeat the texture also you can take a look at this one: Tiling (repeat) sprite texture shader
Or maybe you can handle this by using 9Scale

2 Likes


i want this result

I think the solution you are looking for is the one written above by @selimanac. I was writing the same exact thing.

1 Like

its very difficult ((

Okay, I understand. You can use a different trick here; but it works only in your context and is not a general solution (as the one provided by the link reported above by @selimanac). Let me try to explain.

Prepare a bitmap with as many rings as the body of your robot can hide at the point the chain starts.

Create as many GO as needed for the whole chain and enable them one by one as the chain unroll to the right.

I hope you get the idea…

Ciao!

1 Like

I think about cliping or masking chain and drug for needed length - but its very difficult. Or use factory for spawn for move right - but how return back and hide ((

I think I have not been clear enough. Let me try again.

  1. You prepare a sprite with 4 rings, let’s call it four_rings.
  2. In the editor you add a GO as a root for the whole chain, let’s call it chain_root.
  3. In the editor you add many GO’s as children of chain_root. Each of them has a sprite component with bitmap set to four_rings and you set their x positions so that they glue together and form the complete chain. Let’s say you need 10 of such GO’s and we call them chain_1, chain_2, …, chain_10.
  4. In the script controlling the robot you disable all such GO’s at init.
  5. when the chain has to unroll to the right, you move the x-position of chain_root and, when the position has changed by the width of four_rings, you enable the next GO’s. Starting with chain_1, then you enable chain_2, then chain_3 and so on.
  6. when the chain goes back, you do the same thing, but you disable the GO’s one by one. This time you starts disabling them by chain_10, then chain_9, and so on, till the last GO, i.e. chain_1 has been disabled.

I hope this is somehow clearer. Sorry for the long post…

Ciao!

1 Like

Great. This is a good idea. I can programmatically create links, hiding them behind the torso, attach them to each other and move them.

Thanks a lot

1 Like