Collision Groups with scripts!


I’m making a kart, and when they spawn in I would like them to be able to go through each other. I have set all the parts in the kart to the right collision group when they spawn in. But there still seems to be something in the middle that isn’t on the right collision group (you get stuck). I have checked every part inside the karts to see that they are on the right collision groups and they are.

Please help!

First you have to create a collision group:


Then you have to set it:

part.CollisionGroup = "NameOfCollisionGroup"

Your script would look something like this:

local CollisionName = "Karts"
part.CollisionGroup = "NameOfCollisionGroup"

If you want to make 2 non collidable use:

local CollisonName1, CollisionName2 = "Karts", "Players"
PhysicsService:CollisionGroupSetCollidable(CollisonName1, CollisionName2 , false)

I have already done this. I made the collision group manually and set the collision in the script.

Alright so the issue is the player is still collidable, make a collision group for them as well. When they sit in the car loop through all their baseParts and then set them to Kart as well.

If this does not work you have done something wrong when trying to set the Kart’s collisions. Player’s should be seen as Karts when they are inside of them, so that Karts wont collide.

Well, I have made a separate collision group for the players which I have set to not collide with the kart collision group.

Set it so that players cannot colide with eachother either, if this is not set then this is the problem. If you want players to collide outside of karts, set the collision to kart when the player is in the kart and player when they are not.

Already done this already, sorry.

Then which part is causing the issue, did you make sure to use GetDescendants instead of GetChildren, because I cannot see what the issue is without the script nor the model.

I found the issue it was completely different.

Oh god, put the post as solved so that it gets shelved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.