PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

PhysicsService

Show deprecated

PhysicsService

Show deprecated

PhysicsService is a game service that has functions for working with collision groups, which define a set of parts that may or may not collide with parts assigned to other collision groups. Assign a part to a collision group using PhysicsService/SetPartCollisionGroup|SetPartCollisionGroup. Collision groups and their relationships are saved to and loaded from file.

Network Replication

Creating, deleting and modifying collision relationships between collision groups is limited to server-side Scripts. However, client-side LocalScripts may only set individual parts’ associated collision group.

Properties

Functions

bool

CollisionGroupContainsPart ( string name , Instance part )

Returns whether the part is in the collision group.

void

CollisionGroupSetCollidable ( string name1 , string name2 , bool collidable )

Sets the collision status between two groups.

bool

CollisionGroupsAreCollidable ( string name1 , string name2 )

Returns whether the two groups will collide.

int

CreateCollisionGroup ( string name )

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

int

GetCollisionGroupId ( string name )

Returns the id of the group with the specified name.

string

GetCollisionGroupName ( int name )

Returns the name of the group with the corresponding id.

Array

GetCollisionGroups ( )

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

int

GetMaxCollisionGroups ( )

Returns the maximum number of collision groups.

void

RemoveCollisionGroup ( string name )

Removes the collision group with the given name.

void

RenameCollisionGroup ( string from , string to )

Renames specified collision group.

void

SetPartCollisionGroup ( Instance part , string name )

Sets the collision group of a part.

Events