Skip to main content

ShootArguments

A struct in Root.Township, the global namespace.

Network payload for a shot from a bow or Shooter: the projectile entity, where it was released and how hard. Sent with a MethodSyncStruct in both directions.

Constructors​

MemberWhat it is
ShootArguments(NetworkEntity shot, float strength)Creates a ShootArguments from shot and strength.

Fields​

MemberWhat it is
Chunk chunkChunk the position is relative to. The server uses the projectile's chunk, a client the chunk the local player is in.
Vector3 positionWorld position of the projectile when it was shot.
Quaternion rotationRotation of the projectile, compressed. The constructor also applies the compressed value to the projectile so both sides match.
float strengthShot strength from 0 to 1, sent with 0.001 precision.
uint targetEntity id of the projectile being shot.

Methods​

MemberWhat it is
void Serialize(IPlayer player, Stream stream)Writes or reads the target id, chunk and position, compressed rotation and strength (0 to 1).

Used in​

Members of other types that take, return or hold a ShootArguments: