sm.projectile.playerFire

Creates and fires a projectile from a player.

Kind: Function

Environments: Game

Game

Overload 1

sm.projectile.playerFire(
    name,
    position,
    velocity,
    fakePosThird,
    fakePosFirst,
    delay
)

Open the full Game reference

Availability: Client only

Deprecated: Name is deprecated, use uuid instead

The projectile is normally fired from the player's position, but due to the weapon being held off-center it may require a fake position for where the projectile appears to be fired from.

Parameters:

Name Type Description
name string The projectile's name.
position Vec3 The start position.
velocity Vec3 The direction and velocity.
fakePosThird (optional) Vec3 The visual start position in third-person. (Defaults to position)
fakePosFirst (optional) Vec3 The visual start position in first-person. (Defaults to position)
delay (optional) integer The number of ticks before firing. (Defaults to 0)

Overload 2

sm.projectile.playerFire(
    uuid,
    position,
    velocity,
    fakePosThird,
    fakePosFirst,
    delay
)

Open the full Game reference

Availability: Client only

The projectile is normally fired from the player's position, but due to the weapon being held off-center it may require a fake position for where the projectile appears to be fired from.

Parameters:

Name Type Description
uuid Uuid The projectile's uuid.
position Vec3 The start position.
velocity Vec3 The direction and velocity.
fakePosThird (optional) Vec3 The visual start position in third-person. (Defaults to position)
fakePosFirst (optional) Vec3 The visual start position in first-person. (Defaults to position)
delay (optional) integer The number of ticks before firing. (Defaults to 0)