Skip to content

server.services.Rotation.Rotation

Mahatma Kollu edited this page Oct 19, 2021 · 2 revisions

Class: Rotation

server/services/Rotation.Rotation

Serves to replicate body rotation from the client to other clients by having the client send their joint CFrame info through a server event and then have that info sent to other clients within a distance of them back through a client event.

Implements

  • OnInit

Table of contents

Methods

Methods

onInit

onInit(): void

Hooks the UpdateRotation method to the UpdateRotation server event.

Returns

void

Implementation of

OnInit.onInit

Defined in

src/server/services/Rotation.ts:13


GetPlayersWithinDist

Static Private GetPlayersWithinDist(player, distance): Player[]

Parameters

Name Type
player Player
distance number

Returns

Player[]

players that are within the distance passed in of the player passed in.

Defined in

src/server/services/Rotation.ts:49


UpdateRotation

Static Private UpdateRotation(player, waist, neck, leftshoulder, rightshoulder): void

Takes in a player and their joint cframes and fires an UpdateRotation client event to everyone within a certain distance of that player so that the player's body rotation will replicate.

Parameters

Name Type
player Player
waist CFrame
neck CFrame
leftshoulder CFrame
rightshoulder CFrame

Returns

void

Defined in

src/server/services/Rotation.ts:24

Clone this wiki locally