FANDOM


The PhysicsService class inherits from Instance.

Methods

Pubmethod bool CollisionGroupContainsPart(string name, Instance part)

Returns whether or not the Collision group with the given name contains the given BasePart.

Pubmethod void CollisionGroupSetCollidable(string name1, string name2, bool collidable)

Sets whether or not two collision groups can collide.

Pubmethod bool CollisionGroupsAreCollidable(string name1, string name2)

Returns whether or not two collision groups can collide.

Pubmethod int CreateCollisionGroup(string name)

creates a new collision group with the name. Returns the collision group's id.

Pubmethod int GetCollisionGroupId(string name)

Returns the id of the collision group with the given name.

Pubmethod string GetCollisionGroupName(int name)

Returns the name of the collision group with the given id.

Pubmethod Array GetCollisionGroups()

Returns an array of dictionaries, with each dictionary containing information of the collision group. The information is as follows:

  • id (int): The id of the group.
  • mask (int): The mask of the group, for internal usage.
  • name (string): The name of the group.

Pubmethod int GetMaxCollisionGroups()

Returns the maximum amount of collision groups ROBLOX's physics can handle. This value is currently 32.

Pubmethod void RemoveCollisionGroup(string name)

Removes the collision group with the given name.

Pubmethod void RenameCollisionGroup(string from, string to)

Renames the given collision group name to a new name.

Pubmethod void SetPartCollisionGroup(Instance part, string name)

Sets the given BasePart's CollisionGroupId to the id of the given collision group with the given name.

External links

Community content is available under CC-BY-SA unless otherwise noted.