Skip to content

ClientCaster API

Pyseph edited this page Nov 28, 2020 · 17 revisions

Properties

[Read-Only] RaycastParams RaycastParams

Returns the ClientCaster's set RaycastParams.

Returns whether the ClientCaster object has debug mode enabled, visualizing the ClientCaster's rays.

Returns the object that the ClientCaster is raycasting from.

Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and as such it's recommended to have the client calculate it to have less of a burden on the server.

Functions

Void Debug(Boolean Bool)

Toggles debug mode of this ClientCaster. This feature is light-weight but is not nonetheless not recommended for in-game use.

Void Destroy()

Destroys the ClientCaster object, efficiently cleaning up what's left using a Maid.

Void Initialize()

Initializes the ClientCaster object, starting to raycast for the hit detection.

Void Stop()

Stops the ClientCaster object, making it no longer raycast for hit detection.

Void SetOwner(Player NewOwner)

Sets the given Player as owner for this caster object. When NewOwner is nil, the server will be the owner instead of a Player.

Void GetOwner()

Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and as such it's recommended to have the client calculate it to have less of a burden on the server.

Void EditRaycastParams(RaycastParams RaycastParameters)

Updates the ClientCaster's RaycastParams property.

BasePart GetObject()

Returns the object this ClientCaster is raycasting from.

Void SetObject(BasePart Object)

Sets this ClientCaster's object which it will raycast from to Object.

Events

Fires whenever any object intersects any one of the ClientCaster's rays.

Signal HumanoidCollided(RaycastResult, Humanoid)

Fires whenever any of the ClientCaster's rays intersect with an object, whose parent has a Humanoid object.

Clone this wiki locally