There are 2 teams in my game; you cannot collide with players on your team but you do with enemies players (done using collision groups). However, it is possible to push an enemy by walking into them. I have tried setting all the parts of the starter character (each player uses the same character model) to Massless, but this did not fix anything.
There is a pretty complicated solution for this you can check out. I’ll go look for a more simple one but here it is:
That’s nice because I already had a hitbox part set up in the character model. I used a weld constraint with Part0 set to itself and Part1 set to the humanoid root part (I’m not sure if this is relevant, but the script handling collision groups currently only affects the character’s hitbox, and the other base parts of the character are left in the default group), which is probably the reason for the pushing.
However, I am having trouble setting up the constraints because I have never worked with them before.
This was what I did:
- Create AlignOrientation and AlignPosition constraints and parent them to the hitbox part
- Create a new attachment in the hitbox and set each constraint’s Attachment0 as the new attachment and Attachment1 as the humanoid root part’s rig attachment.
- To see the hitbox, change its transparency; when I tested this, the hitbox was completely missing from the character.
- I added a weld constraint with Part0 set to the hitbox and Part1 to the humanoid root part. Now, the hitbox is visible and moves with the character, but the collisions do not work.
Disregard number 4, as I accidentally turned off CanCollide for the hitbox. Removing the weld constraint causes the hitbox to disappear, still.