Home Animation Showcase & Critiques
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

Fish Animation

polycounter lvl 12
Offline / Send Message
Leinad polycounter lvl 12
Haven't posted in a while, recently I wanted to learn how to animate a group/flock of fish in Unity.

I ended up using shadergraph to animate the individual fish and created a script to control the group motion at run-time.

The flock simulation is called Boids, and it was originally developed by Craig Reynolds. The code I wrote is relatively simple (has 3 main steps).

Separation:
1) Avoid colliding with other fish

Alignment:
2) keep average alignment of nearby fish

Cohesion:
3) move to the average position of nearby fish 


Sign In or Register to comment.