Skip to main content

VelocityPickupSettings

A class in Root.Township, the global namespace.

Pickup type settings for items held with a velocity joint: how strongly the item follows the hand and the joint drive values.

Constructors​

MemberWhat it is
VelocityPickupSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

17 private and internal fields
MemberWhat it is
private float environmentPositionDriveForcePosition spring used when the joint is an environmental joint (no damping).
private float environmentRotationDriveForceRotation spring used when the joint is an environmental joint (no damping).
private bool isLimitingJointPositionIf true, VelocityJoint limits how far the held item can be from the shoulder.
private bool isUsingDistanceCalculationSerialized option. Not read anywhere in this build.
private float positionDamperDamper of the position drive for swingable pickups.
private float positionMaximumForceMaximum force of the position drive for swingable pickups.
private AnimationCurve positionScalerCurve passed to the velocity joint to scale position following.
private float positionSpringSpring of the position drive for swingable pickups.
private float rotationDamperDamper of the rotation drive for swingable pickups.
private float rotationMaximumForceMaximum force of the rotation drive for swingable pickups.
private AnimationCurve rotationScalerCurve passed to the velocity joint to scale rotation following.
private float rotationSpringSpring of the rotation drive for swingable pickups.
private AnimationCurve rotationSpringOverDistanceRotation spring by distance, used by the distance overload of ApplyRotationDrive (which also logs every call).
private float velocityJointPositionMultiplierClient: position multiplier for the held item's velocity joint. The server always uses 9.
private float velocityJointRotationMultiplierClient: rotation multiplier for the held item's velocity joint. The server always uses 75.
private float zAngleRotationLimitAngular Z limit, in degrees, for swingable pickups.
private float zBouncinessBounciness of the angular Z limit for swingable pickups.

Properties​

MemberWhat it is
bool IsLimitingJointPosition { get; set; }Whether the held item is kept within arm's reach of the shoulder.
bool IsUsingDistanceCalculation { get; }Whether the rotation spring should come from the distance curve.
AnimationCurve PositionScaler { get; }Curve that scales how hard the item is pulled toward the hand.
AnimationCurve RotationScaler { get; }Curve that scales how hard the item is turned toward the hand's rotation.
float VelocityJointPositionMultiplier { get; }Client: position pull strength. The server always uses 9.
float VelocityJointRotationMultiplier { get; }Client: rotation pull strength. The server always uses 75.
float ZAngleRotationLimit { get; }Z angle limit for swingable items, in degrees.
float ZBounciness { get; }Bounciness of the Z angle limit for swingable items.

Methods​

MemberWhat it is
JointDrive ApplyEnvironmentalPositionDrive(JointDrive drive)Sets a drive's spring to the environment position force with no damping, for items held against the world.
JointDrive ApplyEnvironmentalRotationDrive(JointDrive drive)Sets a drive's spring to the environment rotation force with no damping.
JointDrive ApplyRotationDrive(JointDrive drive)Sets a drive's spring, damper and max force for rotation. The distance version reads the spring from a curve and logs it.
JointDrive ApplyRotationDrive(JointDrive drive, float distance)Sets a drive's spring, damper and max force for rotation. The distance version reads the spring from a curve and logs it.
JointDrive AppyPositionDrive(JointDrive drive)Sets a drive's spring, damper and max force for position. Used for swingable items.

Used in​

Members of other types that take, return or hold a VelocityPickupSettings: