How to make one actor follow others
Proximo66
Member, BASIC Posts: 2
Anyone know how to make it so that a "hunter" follows a "deer" when they collide if I have a lot of hunters and deers at the same time. Right know it works if I have one hunter/deer: if a Deer Collides with a Hunter then the deer Constrain Attribute Hunter Target X to self position X and the Hunter moves to Hunter Target X. How to (effectively) make it so that the hunters don't hunt the same deer and instead follows the deer they are nearby (collide with)?
Comments
wish I could help.. but alas, I am rather deficient. Can't you make the hunter hunt zombies? Deers are so nice: think Bambi.
@Proximo66
You will need to use tables for this. So instead of using one global attribute (Hunter Target X), you will use tables to store an array of positions, one row for each deer.
Then, instead of using the collide (which will not tell you which hunter detects which deer), use the magnitude function to determine which deer is closest to each hunter.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thank you, I will try that.