How to make one actor follow others

Proximo66Proximo66 Member, BASIC Posts: 2
edited July 2017 in Tech Support

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

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    wish I could help.. but alas, I am rather deficient. Can't you make the hunter hunt zombies? Deers are so nice: think Bambi.

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited July 2017

    @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.

  • Proximo66Proximo66 Member, BASIC Posts: 2

    Thank you, I will try that.

Sign In or Register to comment.