Skip to main content

RaycastGrounded

A class in Root.Township, Alta.Intelligence.

Scoring rule that checks for ground near the creature's body with a ray or sphere, returning one value when ground is found and another when not. Made by CreateTargetOperation.RaycastGrounded.

Constructors​

MemberWhat it is
RaycastGrounded(float groundedValue, float airValue, Vector3 raycastOriginOffset, float raycastDistance, LayerMask layerMask, RaycastGroundedOperationType operationType)Creates a RaycastGrounded from groundedValue, airValue, raycastOriginOffset, raycastDistance, layerMask and operationType.

Fields​

6 private and internal fields
MemberWhat it is
private float airValueValue when nothing is hit.
private float groundedValueValue when ground is hit.
private LayerMask layerMaskLayers counted as ground.
private float raycastDistanceRay length, or the sphere radius for OverlapSphere.
private Func<Vector3, Quaternion, bool> raycastOperationThe check picked from the operation type: a world-down ray, a body-down ray, or a sphere overlap.
private Vector3 raycastOriginOffsetStart point in the body's local space.

Methods​

MemberWhat it is
override float Evaluate(Agent agent, ITarget target)Runs the check from the body's offset point and returns groundedValue on a hit, else airValue. The target is ignored.
override string ToString()Shows the two values.