Table of Contents

Class NearestSplinePoint

Given a CurvySpline and an input position, this class will provide you with the nearest point to that position on the given spline. The nearest position is provided either in an OnUpdated event, or as an override of the position of the TargetPosition

[AddComponentMenu("Curvy/Misc/Nearest Spline Point")]
[ExecuteAlways]
public class NearestSplinePoint : DTVersionedMonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
DTVersionedMonoBehaviour
NearestSplinePoint

Remarks

This script simply calls the GetNearestPoint(Vector3, Space) method. If you are a programmer, you don't need to go through this script, just call GetNearestPoint(Vector3, Space)

Fields

OnUpdated

At each update, this event is called with the result of the lookup

[Tooltip("At each update, this event is called with the result of the lookup")]
public UnityEventEx<Vector3> OnUpdated

Field Value

UnityEventEx<Vector3>

SourcePosition

A transform which position will be used as the input position for the lookup

[Tooltip("A transform which position will be used as the input position for the lookup")]
public Transform SourcePosition

Field Value

Transform

Spline

The CurvySpline on which the nearest position is searched for

[Tooltip("The spline on which the nearest position is searched for")]
public CurvySpline Spline

Field Value

CurvySpline

TargetPosition

A transform which position will be updated with the nearest point on Spline to Source Position

[Tooltip("A transform which position will be updated with the nearest point on Spline to Source Position")]
public Transform TargetPosition

Field Value

Transform

UpdateIn

When to run the lookup

[Tooltip("When to run the lookup")]
public CurvyUpdateMethod UpdateIn

Field Value

CurvyUpdateMethod