Humanoid Acting Weird

I got my pet system set up so that the server spawns the pet and then gives the NetworkOwnerShip to the player, however, weird stuff like this happens where it walks straight through parts.
II have no idea why. There are no collision groups and collisions are turned on.

The pet is controlled by a local script.

As you can see it walks straight through the part it just stood on, this only happens when it tries to ascend.

1 Like

If you put a touched event function in the pets local script does it register a touch when it gets to the first part of the stairs?

Or just make the pet’s Y level the same as the players and keep it close.

That really is some odd behavior. I don’t truly know what’s going on either.

My guess is that it’s an issue with the pet going into physics-sleep and the humanoid setting the positions and rotations of the pet directly. The pet should leave physics-sleep once it touches a part, and my guess is that this is where the system has a problem.

The first thing to check is if the largest parts have their Massless property set to true. The physics engine tends to behave very strangely when the “physics root” doesn’t have any mass, and fails to bring or keep parts out of sleep. If you have any massless parts at all, try setting that property to false on all parts, and see if the issue still occurs. Perhaps also check if any parts have CustomPhysicalProperties with a very low density, because it seems that can cause similar problems.

Another way to potentially solve this would be to periodically force the part out of physics sleep. There are a million different ways to do this, and none of them good, but the most reliable in my experience is to use a weak BodyMover and change its properties every half-second or so. Another is simply to teleport the pet upwards by a fraction of a stud. With both of these methods, it’s important to note that Roblox won’t actually wake the parts unless the change you make is somewhat significant, so there’s basically no way to do this without making changes the player won’t notice (i.e. the BodyMover needs to be strong enough to actually move the parts of the pet and have a significant velocity applied, or the teleportation distance has to be more than 0.1 studs or so), so figuring out how to do this without the players noticing can be somewhat of a challenge.

3 Likes

I messed around for a while and managed to find the issue.
If a single part in the model is not can collide, this starts happening.

This is weird and definitely broken but yeah, making sure all parts are collide-able fixes it.

2 Likes