Skip to main content

WallCollisionHelper

A static class in Root.Township, the global namespace.

Stops fast pickups passing through walls: switches a pickup's rigidbody to continuous collision detection while held and for a while after release, undocking or spawn, then back to discrete. Pickup sets it up for pickups that start discrete.

Fields​

3 private and internal fields
MemberWhat it is
private static Dictionary<uint, Timeline.IEntry> entriesPending reset timers, keyed by entity identifier.
private const float ThrownDurationSeconds of continuous detection after release (10).
private const float UndockedDurationSeconds of continuous detection after undocking or server spawn (5).

Methods​

MemberWhat it is
static void Initialize(Pickup pickup)Hooks a pickup's grab, release, undock and destroy events if its rigidbody is discrete. The server also boosts it for 5 seconds.
7 private and internal methods
MemberWhat it is
private static void CancelEntry(Pickup pickup)Cancels a pickup's pending switch back to discrete.
private static void DelayCollisionDetectionSet(Pickup pickup)Called just after a grab; sets ContinuousDynamic if the pickup is still held.
private static void IncreaseCollisionDetectionForDuration(Pickup pickup, float duration)Sets continuous detection and schedules a return to discrete after the duration if the pickup is then free. Skips docked or kinematic pickups.
private static void InteractionEnded(Interactable interactable, Interactor interactor)On release, keeps continuous detection for ThrownDuration.
private static void InteractionStarted(Interactable interactable, Interactor interactor)On grab, cancels any pending reset and sets ContinuousDynamic after a short delay.
private static void StopListening(NetworkEntity entity, bool isUnload)Unhooks the pickup's events when its entity is destroyed.
private static void Undocked(Interactor interactor, Pickup pickup, PickupDock dock)On undock while not held, boosts detection for UndockedDuration.