YaForcerComponent¶
YaForcerComponent
controls the force acted on the player and its effect. YaForcerComponent
can only function when the Forcer module (https://developer.yahaha.com/manual/yahaha-studio-manual/scripting/module/module-reference/Forcer/) is added to the same object.Functions¶
void Execute(number entityID)¶
SERVER ONLY
Which player being forced by id
entityID
character entityId
void Execute(YaEntity entity)¶
SERVER ONLY
which player being forced by entity
entity
character entity
void SetInitialSpeed(number speed)¶
SERVER ONLY
Sets the initial speed (m/s).
speed
speed(m/s)
void SetForce(number force)¶
SERVER ONLY
Specifies the force acted on the player. If the force is lager than fraction (10 N), the player moves with constant acceleration motion. If the force is smaller than the fraction (10 N), the player moves with constant deceleration motion.
force
force
void SetDirection(float3 direction)¶
SERVER ONLY
Set the real-time direction of the movement.
direction
global direction vector
number GetSpeed()¶
SERVER ONLY
Gets the real-time speed (m/s).
number GetForce()¶
SERVER ONLY
Gets the real-time force.
float3 GetDirection()¶
SERVER ONLY
Gets the real-time direction of the movement.