Flocking Algorithms

Hi I am creating a underwater game with animal (no human). I am currently on AI and i have been following a video tutorial for flocking algorithms everything is going well however my flock are swimming backwards by the tail end can anyone help me set them so they swim forward ? here is the video tutorial (this is the part i am on) and have made it vector 3 so its not 2d like this video

Traditionally “forward” is the +Z axis. You should create your prefabs so that forward aligns +Z on the prefab and this will give you a unified basis to make all your code work with. For instance, if you say:

transform.LookAt( PositionIn3DSpace);

The transform will be oriented so that +Z faces that position.

ah right how do i do this on my prefab?

One way to solving orientation problems is to redo the prefab with an extra GameObject “above” the prefab, then turn the rest of the prefab “below” it to the orientation you want.

Hi i am creating a flocking survival game with fish and sharks. My fish are flocking fine and avoiding obstacles. But What i want is to have the fish flee(separate then come back together) when the shark goes near them and also get the shark to chase and attack members of the flock. How would i go about doing this is anyone could help please?

Please stick a single thread. Do not delete posts, it muddies the topic.

I have solved this original post so wanted a separate question