codeAPI Reference

s&box RollermineNpc: Physics-driven NPC

calendar_today May 12, 2026 schedule ~2 min read person PatrickJr verified 50

RollermineNpc Class API Reference

RollermineNpc is a physics-driven NPC that chases players, leaps at them, and bounces off dealing damage on contact. Implements IDamageable and ICollisionListener.

Type Signature

CSHARP
public class RollermineNpc : Npc, Component.IDamageable, Component.ICollisionListener
{
    [Property, ClientEditable, Range(1f, 500f), Sync] public float Health { get; set; } = 35f;

    [Property, Group("Balance")] public float RollForce { get; set; } = 80000f;
    [Property, Group("Balance")] public float RollTorque { get; set; } = 40000f;
    [Property, Group("Balance")] public float StuckJumpForce { get; set; } = 500f;
    [Property, Group("Balance")] public float LeapForce { get; set; } = 60000f;
    [Property, Group("Balance")] public float LeapUpwardBias { get; set; } = 0.2f;
    [Property, Group("Balance")] public float BounceForce { get; set; } = 450f;
    [Property, Group("Balance")] public float ContactDamage { get; set; } = 20f;
    [Property, Group("Balance")] public float LeapRange { get; set; } = 160f;

    [Property] public GameObject Eye { get; set; }
    [Property, Group("Effects")] public GameObject HuntingEffects { get; set; }
    [Property, Group("Effects")] public GameObject LeapEffect { get; set; }
    [Property, Group("Effects")] public GameObject ContactEffect { get; set; }
    [Property, Group("Effects")] public SoundEvent RollSound { get; set; }

    [Property, Group("Effects")] public float PitchSpeedMax { get; set; } = 600f;
    [Property, Group("Effects")] public float PitchMin { get; set; } = 0.6f;
    [Property, Group("Effects")] public float PitchMax { get; set; } = 1.6f;

    public void SetHunting(bool hunting);
    [Rpc.Broadcast] public void BroadcastLeapEffect();
    [Rpc.Broadcast] public void BroadcastContactEffect(Vector3 position);
}

Properties

Balance:


Effects:

Methods

SetHunting(bool hunting)

Toggles hunting state, enables/disables effects, expands collider radius.

BroadcastLeapEffect()

Broadcast RPC that clones LeapEffect at current position.

BroadcastContactEffect(Vector3 position)

Broadcast RPC that clones ContactEffect at hit position.

IDamageable Implementation

ICollisionListener Implementation

Usage

CSHARP
// Create a rollermine
var npc = GameObject.Components.Create<RollermineNpc>();
npc.ContactDamage = 30f;
npc.LeapForce = 80000f;

Notes

  • Uses schedules: RollermineChaseSchedule, RollermineIdleSchedule
  • Roll sound pitch scales with velocity
  • Eye tracks nearest visible target
  • Bounces up and away from targets
Was this helpful?