I set up the collision groups in my game and I playtested it with a friend of mine. My friend realized that he could get in the way of moving Humanoids, becoming a barrier so they couldn’t move. I tried doing the same things and the Humanoids went through me (I set the collision groups to not collide with players).
I shut off the server and removed CanCollide in everything I could inside of the Humanoid.
We tried again and he could still get in the way and I couldn’t; this also happened with all of the collision groups, not just one.
How can I fix this? Btw this is how I have my collision groups set up:
The collision groups you are showing, shows that all groups collide with all groups. How have you set up that players don’t collide with other groups? If there is a script handling this, then please provide.
You see, that’s your problem. Humanoids set CanCollide to true in most parts. Did you set the CollisionGroup of the parts inside the Humanoid correctly?
Also, I remember a tutorial on how to do this. I forgot what it was called, possibly something like “No player collision”?
What I did in my scripts is when spawning a character (not a player), the script loops through all of the BaseParts inside of that model and assigns the BaseParts to a collision group using a for loop.
I’ll check out the tutorial to see if it can help, thanks.
The tutorial I was following said that if I set up the collision groups like that, things wouldn’t collide with each other. It worked in my client but not in others, if you can tell me how I should arrange them and why please do so. What should happen is that the Player, Tower and Attacker shouldn’t collide with each other.
I have 2 functions where an Attacker spawns and another function where the Tower spawns. The script loops through all of the Model’s children and if they are a BasePart, they get assigned into the Attacker or Tower collision group; in the script I also assign the HumanoidRootPart’s network owner to nil.
for i, object in ipairs(newAttacker:GetDescendants()) do
if object:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(object, "Attacker")
end
end
I use the same loop to assign the other stuff’s collision group, I just change some parameters.
You have set up the collision groups correctly, have you followed this reference for the scripting of adding the players to the Player collision group:
I haven’t followed any reference, I followed a tutorial where they explained that if I wanted things to collide with Default but not collide with each other, I should put the checkmarks like that.
player.CharacterAdded:Connect(function(character)
for i, object in ipairs(character:GetDescendants()) do
if object:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(object, "Player")
end
end
end)
This is the bit of code that loops through the players and assigns every BasePart in their Model to a collision group.
I’ll use the reference you sent and I’ll playtest it later with my friend, thanks.
My friend playtested the game to see if it was fixed (after I used the reference you sent) and his client ignored the collision groups once again.
3 more people playtested the game and the collisions worked well for them, I’ll just say that the bug is fixed bc it seems to only happen in his client and not in everyone else’s client.
Thanks for the help.
Very interesting… sorry couldn’t help iron it out more… I was about to suggest network ownership issue since it was happening only to one client.