Overloads
static SceneTraceResult ShootBullet (Scene scene, Ray ray, float distance, float radius, float damage, float force, GameObject attacker, GameObject weapon, GameObject ignore, TagSet tags)

Remarks

Damage and the physics impulse are applied on the host only, so it stays authoritative no matter who calls it - a client still gets the trace result back for effects, but can't deal damage. Call it from the host (or a host-routed path) when you want the hit to count.

Parameters

NameTypeDescription
scene Scene Scene to trace in.
ray Ray Origin and direction of the bullet (apply any aim cone before calling).
distance float How far the bullet travels.
radius float Bullet radius - 0 for a thin ray, higher to be forgiving.
damage float Damage dealt to what we hit.
force float Impulse applied to the hit physics body, along the bullet direction.
attacker GameObject Who fired this - credited for the damage and ignored by the trace.
weapon GameObject The weapon GameObject, recorded on the damage.
ignore = null GameObject Hierarchy to ignore. Defaults to .
tags = null TagSet Optional damage tags (e.g. "bullet").

Returns

TypeDescription
SceneTraceResult
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.