Skip to content
EvilEngine.Api.Weapons

WeaponProjectile record

public sealed record WeaponProjectile

What a weapon launches through IWeaponHolder.Launch: a model that flies on its own, either traced by the engine every tick or as a physics body that bounces and rolls. Every vector is a MapVector in meters on Godot’s axes.

holder.Launch(holder.Eye, new WeaponProjectile(bolt)
{
    Velocity = new MapVector(holder.Aim.X * 88.9, holder.Aim.Y * 88.9, holder.Aim.Z * 88.9), Gravity = 0.05
}, new Bolt());
Assembly
EvilEngine.Api
Commit
4ff877b1

Members

WeaponProjectile constructor

public WeaponProjectile(ContentId Model)

The model it draws as.

Model property

public ContentId Model { get; init; }

The model’s id. The projectile can swap it as it flies.

Velocity property

public MapVector Velocity { get; init; }

How fast and which way it leaves, in meters a second.

Orientation property

public Orientation? Orientation { get; init; }

How it’s turned, or null to face along its velocity every tick, like an arrow.

Spin property

public MapVector Spin { get; init; }

How fast it turns, in radians a second about each axis.

Gravity property

public double Gravity { get; init; }

How much of the world’s gravity pulls it, 1 for all of it and 0 for none.

Physical property

public bool Physical { get; init; }

Whether it’s a physics body that bounces, rolls and can be grabbed, like a grenade, instead of a traced point. It needs the model’s collision; without one it flies traced.

Mass property

public double? Mass { get; init; }

A physical projectile’s mass in kilograms, or null for its model’s own.

Damping property

public double? Damping { get; init; }

How much of a physical projectile’s speed it sheds each second, or null for the world’s.

Size property

public double Size { get; init; }

The half width of the box it sweeps through the world, in meters, or 0 for a line.

Skin property

public int Skin { get; init; }

The model’s skin.

Glow property

public ProjectileGlow? Glow { get; init; }

A glowing sprite on it, if any.

Trail property

public ProjectileTrail? Trail { get; init; }

A trail behind it, if any.