API:Class/PhysicsService

Server only:This service is server-side only! You should use a Script instead of a LocalScript when using it.
Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.

Debris icon.pngPhysicsService : Object Icon.pngInstance

The PhysicsService is responsible for handling the physics of Roblox. It allows you to establish part collision groups, where certain parts are able to collide with each other while others can't.

Functions

Functions [toggle]

boolCollisionGroupContainsPart ( string name, BasePart part )

Returns whether the part is in the collision group.

|RMD member="API:Class/PhysicsService/CollisionGroupContainsPart"|Returns whether the part is in the collision group.|/RMD|
voidCollisionGroupSetCollidable ( string name1, string name2, bool collidable )

Sets the collision status between two groups.

|RMD member="API:Class/PhysicsService/CollisionGroupSetCollidable"|Sets the collision status between two groups.|/RMD|
boolCollisionGroupsAreCollidable ( string name1, string name2 )

Returns whether the two groups will collide.

|RMD member="API:Class/PhysicsService/CollisionGroupsAreCollidable"|Returns whether the two groups will collide.|/RMD|
intCreateCollisionGroup ( string name )

Creates a new collision group with the given name, and returns the id of the created group.

|RMD member="API:Class/PhysicsService/CreateCollisionGroup"|Creates a new collision group with the given name, and returns the id of the created group.|/RMD|
intGetCollisionGroupId ( string name )

Returns the id of the group with the specified name.

|RMD member="API:Class/PhysicsService/GetCollisionGroupId"|Returns the id of the group with the specified name.|/RMD|
stringGetCollisionGroupName ( int name )

Returns the name of the group with the corresponding id.

|RMD member="API:Class/PhysicsService/GetCollisionGroupName"|Returns the name of the group with the corresponding id.|/RMD|
array<dictionary>GetCollisionGroups ( )

Returns a table with info on all of the place’s collision groups.

|RMD member="API:Class/PhysicsService/GetCollisionGroups"|Returns a table with info on all of the place’s collision groups.|/RMD|
intGetMaxCollisionGroups ( )

Returns the maximum number of collision groups.

|RMD member="API:Class/PhysicsService/GetMaxCollisionGroups"|Returns the maximum number of collision groups.|/RMD|
voidRemoveCollisionGroup ( string name )

Removes the collision group with the given name.

|RMD member="API:Class/PhysicsService/RemoveCollisionGroup"|Removes the collision group with the given name.|/RMD|
voidRenameCollisionGroup ( string from, string to )

Renames specified collision group.

|RMD member="API:Class/PhysicsService/RenameCollisionGroup"|Renames specified collision group.|/RMD|
voidSetPartCollisionGroup ( BasePart part, string name )

Sets the collision group of a part.

|RMD member="API:Class/PhysicsService/SetPartCollisionGroup"|Sets the collision group of a part.|/RMD|
Returns whether the part is in the collision group.
CollisionGroupSetCollidable ( string name1, string name2, bool collidable )
Sets the collision status between two groups.
Returns whether the two groups will collide.
Creates a new collision group with the given name, and returns the id of the created group.
Returns the id of the group with the specified name.
Returns the name of the group with the corresponding id.
Returns a table with info on all of the place’s collision groups.
Returns the maximum number of collision groups.
Removes the collision group with the given name.
Renames specified collision group.
Sets the collision group of a part.


|RMD member="API:Class/PhysicsService"|The PhysicsService is responsible for handling the physics of Roblox. It allows you to establish part collision groups, where certain parts are able to collide with each other while others can't. |/RMD|