An artificially simulated pushable pusher.
Collider- A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
- Place the
VRTK_ArtificialPusherscript onto the GameObject that is to become the pusher.
- Pressed Distance: The distance along the
Operate Axisuntil the pusher reaches the pressed position.
- Min Max Limit Threshold: The threshold in which the pusher's current normalized position along the
Operate Axishas to be within the minimum and maximum limits of the pusher.
- Resting Position: The normalized position of the pusher between the original position and the pressed position that will be considered as the resting position for the pusher.
- Resting Position Threshold: The normalized value that the pusher can be from the
Resting Positionbefore the pusher is considered to be resting when not being interacted with.
- Press Speed: The speed in which the pusher moves towards to the
- Return Speed: The speed in which the pusher will return to the
Target Positionof the pusher.
public override float GetValue()
float- The actual position of the pusher.
The GetValue method returns the current position value of the pusher.
public override float GetNormalizedValue()
float- The normalized position of the pusher.
The GetNormalizedValue method returns the current position value of the pusher normalized between
public override void SetValue(float value)
float value- Not used.
The SetValue method is not implemented as the pusher resets automatically.
public override bool IsResting()
trueif the pusher is currently at the resting position.
The IsResting method returns whether the pusher is currently at it's resting position.
public virtual void SetStayPressed(bool state)
bool state- The state to set the
Stay Pressedparameter to.
The SetStayPressed method sets the
Stay Pressed parameter to the given state and if the state is false and the pusher is currently pressed then it is reset to the original position.
public virtual void SetPositionTarget(float normalizedTarget)
float normalizedTarget- The
Position Targetto set the pusher to between
The SetPositionTarget method sets the
Position Target parameter to the given normalized value.
Updated less than a minute ago