Photon Bolt Engine API  1.2.9
Public Attributes | List of all members
Bolt.LagCompensation.BoltPhysicsHit Struct Reference

Describes a hit to a BoltHitbox on a BoltHitboxBody More...

Public Attributes

BoltHitboxBody body
 The body which was hit More...
 
float distance
 The distance away from the origin of the ray More...
 
BoltHitbox hitbox
 Which hitbox was hit More...
 

Detailed Description

Describes a hit to a BoltHitbox on a BoltHitboxBody

Example: Logging the details of a BoltPhysicsHit object.

void FireWeaponOwner(PlayerCommand cmd, BoltEntity entity) {
if(entity.IsOwner) {
using(BoltPhysicsHits hits = BoltNetwork.RaycastAll(new Ray(entity.transform.position, cmd.Input.targetPos),
cmd.ServerFrame))0 {
if(hit.count > 0) {
BoltPhysicsHit hit = hits.GetHit(0);
Debug.Log(string.Format("[HIT] Target={0}, Distance={1}, HitArea={2}", hit.body.gameObject.name, hit.distance, hit.hitbox.hitboxType);
}
}
}
}

Member Data Documentation

◆ body

BoltHitboxBody Bolt.LagCompensation.BoltPhysicsHit.body

The body which was hit

◆ distance

float Bolt.LagCompensation.BoltPhysicsHit.distance

The distance away from the origin of the ray

◆ hitbox

BoltHitbox Bolt.LagCompensation.BoltPhysicsHit.hitbox

Which hitbox was hit