I am making a npc type of pet system and i want the npc to collide with nothing not even the map, It uses raycasting, And i think collision with a pet system isnt that good looking. Yes i have used physicsservice, But its not what im looking for considering id have to get all of the items in workspace and set the collision group to a group.
1 Like
So, you don’t actually need to get all the parts in the workspace. Roblox conveniently puts all part’s into a ‘Default’ collision group when created, which remains until you change it yourself.
With this in mind, you can create a collision group with the pet and the map floor, and set the collision status to true,
And then simply set the collision status of that group, and ‘Default’ to false:
local Physics = game:GetService('PhysicsService')
Physics:CreateCollisionGroup('test')
Physics:CollisionGroupSetCollidable('test','test', true)
Physics:CollisionGroupSetCollidable('test','Default', false)
Physics:SetPartCollisionGroup(script.Parent, 'test')
Physics:SetPartCollisionGroup(workspace.Baseplate, 'test')
Which provides this output: https://gyazo.com/b0d03cc0a867a0f81fc0f4dae5e0ecf0
2 Likes