A physics based 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.
Rigidbody- A Unity Rigidbody to allow the GameObject to be affected by the Unity Physics System. Will be automatically added at runtime.
VRTK_ControllerRigidbodyActivator- A Controller Rigidbody Activator to automatically enable the controller rigidbody upon touching the pusher.
- Create a pusher container GameObject and set the GameObject that is to become the pusher as a child of the newly created container GameObject.
- Place the
VRTK_PhysicsPusherscript onto the GameObject that is to become the pusher.
The Physics Pusher script must not be on a root level GameObject. Any runtime world positioning of the pusher must be set on the parent container GameObject.
- Pressed Distance: The local space distance along the
Operate Axisuntil the pusher reaches the pressed position.
- Stay Pressed: If this is checked then the pusher will stay in the pressed position when it reaches the maximum 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.
- Position Target: The normalized position of the pusher between the original position and the pressed position.
0fwill set the pusher position to the original position,
1fwill set the pusher position to the pressed position.
- Target Force: The amount of force to apply to push the pusher towards the intended target position.
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 ConfigurableJoint GetControlJoint()
ConfigurableJoint- The joint associated with the control.
The GetControlJoint method returns the joint associated with the control.
Updated less than a minute ago