Skip to content

RaycastHit

namespace Griff.Runtime;
public struct RaycastHit

Where a ray first touched a collider or a solid tilemap.

public float Distance { get; init; }

World units from the ray’s origin to Point.

public Entity Entity { get; init; }
public Vector2 Normal { get; init; }

The surface direction at the hit, pointing back toward the ray (e.g. up for a floor).

public Vector2 Point { get; init; }
public void Deconstruct(out Entity Entity, out Vector2 Point, out Vector2 Normal, out float Distance)
public override bool Equals(object obj)
public bool Equals(RaycastHit other)
public override int GetHashCode()
public override string ToString()