ScaledLerpFollow
A class in Root.Township, the global namespace.
Footstep effect that trails a player's feet and plays step sounds and size-scaled particles as they move on the ground. Client only by default (from LerpFollowBase).
- Listed in Global namespace: S
- Inherits or implements
LerpFollowBase<PlayerController>
Constructors
| Member | What it is |
|---|---|
ScaledLerpFollow() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
16 private and internal fields
| Member | What it is |
|---|---|
private static HashSet<ScaledLerpFollow> activeLerps | Every live follower, so SetVolume can reach them. |
private float currentTimeDelay | Time left before another step can play. |
private bool hasEffect | Whether a particle is set. |
private bool hasSound | Whether a step sound is set. |
private float intervalBetweenParticlesSquared | Squared distance between steps, scaled by the ground's speed modifier. |
private float localSoundVolume | Step volume for your own player. Worked out but not passed to the sound in this build. |
private float maximumDistanceSquared | Squared per-frame distance that maps to the top of sizeCurve. |
private float minimumDistanceSquared | Squared per-frame distance below which no step plays. |
private float minTimeDelay | Shortest time between two steps. |
private PooledObjectDefinition particleSystem | Pooled particle spawned at each step. |
private float remoteSoundVolume | Step volume for other players. Like the local one, not actually applied. |
private Vector3 rotationOffset | Extra rotation applied to each spawned particle. |
private AnimationCurve sizeCurve | Curve from movement speed to particle scale. |
private SoundEffectSet soundEffect | Step sound, unless the ground overrides it with its own. |
private PlayerController target | Backing field for Target. |
private float travaledDistance | Squared distance left before the next step. |
Properties
| Member | What it is |
|---|---|
EffectPlayStatus PlayStatus { get; set; } | Flags that can turn off the sound or the particle part of the effect. |
override PlayerController Target { get; } | The player being followed. |
protected override Vector3 TargetPosition { get; } | The followed player's feet position. |
Methods
| Member | What it is |
|---|---|
override void SetTarget(PlayerController target) | Sets the player to follow. |
static void SetVolume(float local, float remote) | Sets local and remote step volume on every active follower. The setvolume console command calls it. |
override void Start() | Checks which effects are set, joins the active list and reads the self step volume setting. |
protected override void Moving(Vector3 from, Vector3 to) | Each frame while grounded: after enough distance and time, plays a step sound and spawns a particle scaled by speed. |
2 private and internal methods
Used in
Members of other types that take, return or hold a ScaledLerpFollow: