Skip to main content

MushroomCritter

A class in Root.Township, the global namespace.

Tuning values for a schmeechee (mushroom critter): floor checks, push and turn forces, flipping and planting. A component read by Schmeechee and its actions.

Constructors​

MemberWhat it is
MushroomCritter()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
AnimationCurve embedOffsetCurve of the model's vertical offset while planting; its last key is how long planting takes.
LayerMask floorLayers counted as floor.
float floorCheckDistanceLength of the downward ground check ray.
float floorCheckOffsetOffset along up for where the ground check starts.
float forceForward push while playing or fleeing.
float headCheckDistanceLength of the ray from the head to check for being upside down.
float headCheckDownAlignmentHow far the critter must face down (dot with down) before it can count as upside down.
float headCheckOffsetOffset for where the head check ray starts.
float headFlipForceMaxMaximum impulse used to flip back over.
float headFlipForceMinMinimum impulse used to flip back over.
float headFlipTimerMaxMaximum wait before a flip attempt.
float headFlipTimerMinMinimum wait before a flip attempt.
float headFlipTorqueMaxMaximum torque impulse used to flip back over.
float headFlipTorqueMinMinimum torque impulse used to flip back over.
float hoverForceUpward force added while playing or fleeing.
float kinematicTimeSeconds into planting before the rigidbody goes kinematic.
float maximumAppliedTurnForceLargest turn torque applied in one step.
float maximumStoredTurnForceLargest turn force that can build up.
float maxTurnVelocityTurn speed limit setting (default 15). Not read anywhere in this code.
float maxVeloctiySpeed cap while playing or fleeing.
float popVelocityUpward speed it pops out of the ground with when planting ends.
float turnJerkPerSecHow fast turn force builds up per second when steering.
float uprightTorqueLerpUpright torque blend setting (default 0.5). Not read anywhere in this code.
float uprightTorqueMultiplierStrength of the torque that keeps it upright.

Properties​

MemberWhat it is
MushroomCritter Hit { get; set; }The last other mushroom critter this one bumped into.

Methods​

2 private and internal methods
MemberWhat it is
private void OnCollisionEnter(Collision collision)Records another MushroomCritter it bumps into as Hit.
private void OnDrawGizmosSelected()Editor: draws the head check line used for flip detection.

Used in​

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