Do you guys have an idea of how i could do something like that ? Scripting or joints ?
Note1: I dont need them to respect a particular shape as a group.
Note 2: If a member of the group gets too far of the rest of the group he doesnt come back
SCRIPTING
I was thinking i could just use a simple follow script, so that one object follow the object ahead of him.
But i fear this involve a lot of calculation (cpu)…
Also, not sure this is optimal, as i dont want objects to follow another lost object (that doesnt follow the rest of the group anymore for some reason, or because its destroyed)
If I had this problem to solve I’d try to use particles and physics using an attract attribute like magnetism or a modified gravity setup.
It would look something like this -
X number of particles in the scene. Game object which the particles are attracted to (magnet). Animate the magnet around the scene and the particles follow in a randomized pattern. The magnets influence is reduced based on distance from the magnet and at a specified distance the magnets influence drops to 0.
May search for a planetary gravity setup. The planetary gravity setup could be modified to simulate the magnet effect.
Lastly i’ve adapted the Reynolds Algorithm, i had a lot fun but i couldnt get what i was looking for.
Mainly because with this algorithm an object moves depending on the position of all the others.
Your “magnet suggestion” seems to be closer of what i need. I’ll give it a try this week and let you know how it went.
Reviving this old thread cause i’ve been messing around with this boid script
What i’ve for now is :
Boids that follow the BoidController
My BoidController rotates around the flock center depending on the Xbox Controller joystick angle
The issue i’m having is that the boids are not very reactive. What i mean is that, if the boidcontroller position suddenly changes, the boids make very wide turns. So for instance i’m currenlty not able to make them turn back instantly.
For me this has nothing to do with minspeed or maxspeed.
I tried with minvelocity to 0.
I tried to change the waitTime of BoidFlocking.cs. things get better but they dont turn back instantly.
So basically what i would like to achieve is make the boids turn sharp instead of wide.
Not sure how i could do that… I am open to any suggestions !