Some games have a mechanic in which groups of pets follow the player around, and work or play in the vicinity of the player. For example, one game has a bunch of bees following the player around. Other games use ground based pets which do a similar thing.
1. Following
What is the typical procedure used to get such groups to follow the player?
2. Individual Behavior
How do I get individual behavior in these groups? In many games, the pets seem to wander around and do their own thing, while staying in the vicinity of the player.
3. Ground Level
The terrain can have different elevations, so how do you determine the ground level for each pet?
4. Without Stressing Server
With 25 or more pets per player, I worry about stressing the server and introducing lag with too many moving pets. Is there a server friendly way to do this?
For number one, you can just use CollectionService, put in a loop and have a spawn() function or ccoroutine where inside of it, it follows the player using :MoveTo. So each of the pets can try to move along simultaneously, if not just put a wait with a random number from 1 to 2
Yeah I agree, also when you do make this @MapleMarvel you’re going to want to do all the tweening locally or else it will be just as choppy as SetPrimaryCFrame.
I don’t see any choppiness at all in some of these games that have groups of pets.
I don’t think Humanoid:MoveTo is used. This would not work with flying pets for example.
I don’t think SetPrimaryCFrame is used since it is too choppy.
I don’t think constraints are being used. An AlignPosition constraint would work, but always have the same offset to the player, which is not how pets in some of these games appear.
It could be a BodyMover which can handle following the player, and also some random individual movement. But I wonder if too many BodyMovers would cause lag.
Not sure about Tween Service. Do people really use it for such tasks?
Unfortunately, it has to be done every frame, or the result is jittery. I used this method for making rain particles follow the player when attempting to create a stormy atmosphere.
It worked for my use, it might work for controlling the group of pets for you - but you’d still need to figure out individual movements within the group.