3
\$\begingroup\$

Recently I've been trying to create a controllable fish character. The game is 2D and top-down.

My two approaches are:

  • Skeletal Animation, which is versatile but looks too robotic. For example, no matter how hard I turn, the fish has the same turning animation.
  • Procedural Animation, which I implemented using a line renderer following a tutorial from the channel Blackthornprod. It is very close to what I want, the fish is dynamic. The problem is that the fish loses all form when turning, some parts get thinner while some parts get thicker. The other thing is that it's hard to make it work with different types of fish sprites.

Here is an example, the black fish is animated using bones and the animator. The white fish is procedurally animated using a line renderer and the material with the sprite as a texture: [fish swimming gif2

I want to be able to move the upper part of the fish, while the tail follows in a chain-like manner. Preferably avoiding line renderer as I'm not too comfortable with the pixelated edges and needing to loop through hundreds of positions to animate only one fish.

I would love any suggestions and I'm thankful to anyone who takes the time to help me!

\$\endgroup\$
4
  • \$\begingroup\$ Hint: you can move bones procedurally too, such as choosing a blending weight between a slight-turn and hard-turn animation, getting something intermediate between the two. You may want to show examples of the problems you're having with each method to help target fixes at those issues. \$\endgroup\$ Commented Jun 11, 2022 at 12:18
  • \$\begingroup\$ I coded this app for programers who cannot draw: youtube.com/watch?v=m72AlW-YADQ maybe this could help you as well? \$\endgroup\$ Commented Jun 11, 2022 at 18:11
  • 2
    \$\begingroup\$ @mourad It's not immediately obvious what your application does or how it would help the OP. It would be better to explain how your application might help the OP, so your suggestion looks like more than mere linkspam advertising. \$\endgroup\$ Commented Jun 13, 2022 at 23:45
  • \$\begingroup\$ yes sorry for the bad comment! I wasn't trying to promote my app here but I see many programmers struggling with art. So basically you use bones in blender to animate and you export it to 2d (I suppose OP is doing 2d?). My bad :-( \$\endgroup\$ Commented Jun 15, 2022 at 5:47

2 Answers 2

4
\$\begingroup\$

A solution was using the skeletal animation approach and adding inverse kinematics (let's call this IK) to the tail.

I made it so the tail IK wouldn't rotate with the body which meant that the tail IK wouldn't be affected by the rotation of the body. Then during the movement, I simply rotated the tail IK slowly towards the body.

tailSolver.rotation = Quaternion.RotateTowards(tailSolver.rotation, upperBody.rotation, lerpSpeed); 

Here is an example of the animation using this approach:

Fish movement

\$\endgroup\$
1
  • \$\begingroup\$ Can you share this sample full project? \$\endgroup\$ Commented Sep 1 at 16:01
0
\$\begingroup\$

I've also been developing a fish styled game for a few years and this was what I managed to Come up with, essentially a particle system trail. But the only issue with this is the tail shrinks to much when you stop. πŸ˜…

Probably a simple fix. Tbh I just havnt thought of it yet. https://vt.tiktok.com/ZSkDWBCJb/

Sorry if this isn't the right way to respond. Just saw this and thought I'd share with you my progress on a similar project. πŸ˜‡

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Answer posts should usually explain more about the "how" of the solution in the body of the post, rather than relying on an external link. Consider embedding some images so that a reader is accessing this page from a network where TikTok is blocked can still see what you're talking about \$\endgroup\$ Commented Jun 8 at 11:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.