Nested character physics issue

In my place, players can equip “Pets” that will follow them around. To do this, I have a model of the pet cloned into their character, give them network ownership of the pet, and then they control how it moves (some fly around their heads, others follow behind them and jump when they jump, etc.).

This seems to work, but there is one side effect: if the pet gets stuck on something as it tries to keep up with the owner, and the owner jumps, their character will be pushed in the direction the pet is moving. It seems like by walking into wall, the pet adds an overall force to the player’s character, despite the parts not being connected with any joints.

Does anyone know why this happens, and if there is a way around it? If not, I guess I’ll just have to go back to having the pet model be separate from the player characters.

1 Like

I suppose the first question to ask is are the MeshParts that make up the Pets non-CanCollide? If not, when the Pets are created or cloned from a (supposed) reference Model, they should first have their CanCollide property set to false.

Otherwise, this may be a Scripting Support issue, meaning it is an issue that can be fixed by usages of PhysicsService’s various CollisionGroup API.

If you still come to find that even after making the Pets non-CanCollide, you can use PhysicsService’s CreateCollisionGroup, SetPartCollisionGroup, and CollisionGroupSetCollidable API to change the CollisionGroupId of those Parts in your game and make it so they’re always non-reactive to the native Physics CollisionGroupId (0).

Thanks for the reply. For my flying pets, I do make them non-collideable. However, I also have grounded pets that need to be able to collide with the parts in the map since they use MoveTo.

I think I’m just going to keep the pets separate from the characters for now.

1 Like

Well I applaud you for doing something different with your pets. Among the masses of the games who use pets to help aid the character’s progress in the game, I’ve yet to see pets actively using the ground - they’re always just floating around the Player magically; never interacting with the game itself.

Good luck, nonetheless.