So the base gamemode has this
[ServerCommand( "noclip", Help = "Turns on noclip mode, which makes you non solid and lets you fly around" )]
public static void NoclipCommand()
{
if ( ConsoleSystem.Caller == null ) return;
(Current as Game)?.DoPlayerNoclip( ConsoleSystem.Caller );
}
which calls this on the gamemode class
public virtual void DoPlayerNoclip( Player player )
{
// TODO - check can use cheats
if ( player is BasePlayer basePlayer )
{
if ( basePlayer.DevController is NoclipController )
{
Log.Info( "Noclip Mode Off" );
basePlayer.DevController = null;
}
else
{
Log.Info( "Noclip Mode On" );
basePlayer.DevController = new NoclipController();
}
}
}
On the player the DevController is always used if it’s set, it has priority over the default controller.
public override PlayerController GetActiveController()
{
if ( DevController != null ) return DevController;
return Controller;
}
This means it’s possible to add other development movement types. I can’t actually think of any others that would be useful, but the door is opened by this anyway