I made a car that it's body is a union. I enable CanCollide, at the same time, I made a PhysicsService script in the model so that the wheels and other important parts of the chassis won't end up touching the union. The only problem is the constraints, it keeps glitching

The constraints are in SpringMount and WheelMount.

Script:

local PartA = script.Parent.BodyFrame
local PartB = script.Parent.Chassis.WheelFL.WheelPart
local PartC = script.Parent.Chassis.WheelFR.WheelPart
local PartD = script.Parent.Chassis.WheelRL.WheelPart
local PartE = script.Parent.Chassis.WheelRR.WheelPart
local PartF = script.Parent.Chassis.WheelFL.SpringMount
local PartG = script.Parent.Chassis.WheelFR.SpringMount
local PartH = script.Parent.Chassis.WheelRL.SpringMount
local PartI = script.Parent.Chassis.WheelRR.SpringMount
local PartJ = script.Parent.Chassis.WheelFL.WheelMount
local PartK = script.Parent.Chassis.WheelFR.WheelMount
local PartL = script.Parent.Chassis.WheelRL.WheelMount
local PartM = script.Parent.Chassis.WheelRR.WheelMount

local PhysicService = game:GetService("PhysicsService")

PhysicService:CreateCollisionGroup("GroupA")
PhysicService:CreateCollisionGroup("GroupB")

PhysicService:CollisionGroupSetCollidable("GroupA", "GroupB", false)

PhysicService:SetPartCollisionGroup(PartA, "GroupA")
PhysicService:SetPartCollisionGroup(PartB, PartC, PartD, PartE, PartF, PartG, PartH, PartI, PartJ, PartK, PartL, PartM, "GroupB")

2 comments

0

You know about tables, right?

0

and wouldn't it just be easier to change the collision group of the chassis rather than the wheel parts?