@@ -36,6 +36,7 @@ void Start()
36
36
ConsoleCommandsDatabase . RegisterCommand ( HelpCommand . name , HelpCommand . description , HelpCommand . usage , HelpCommand . Execute ) ;
37
37
ConsoleCommandsDatabase . RegisterCommand ( LoadCommand . name , LoadCommand . description , LoadCommand . usage , LoadCommand . Execute ) ;
38
38
ConsoleCommandsDatabase . RegisterCommand ( GodCommand . name , GodCommand . description , GodCommand . usage , GodCommand . Execute ) ;
39
+ ConsoleCommandsDatabase . RegisterCommand ( NoClipCommand . name , NoClipCommand . description , NoClipCommand . usage , NoClipCommand . Execute ) ;
39
40
ConsoleCommandsDatabase . RegisterCommand ( NoTargetCommand . name , NoTargetCommand . description , NoTargetCommand . usage , NoTargetCommand . Execute ) ;
40
41
ConsoleCommandsDatabase . RegisterCommand ( ToggleAICommand . name , ToggleAICommand . description , ToggleAICommand . usage , ToggleAICommand . Execute ) ;
41
42
ConsoleCommandsDatabase . RegisterCommand ( CreateMobileCommand . name , CreateMobileCommand . description , CreateMobileCommand . usage , CreateMobileCommand . Execute ) ;
@@ -385,6 +386,31 @@ public static string Execute(params string[] args)
385
386
}
386
387
}
387
388
389
+ private static class NoClipCommand
390
+ {
391
+ public static readonly string name = "tcl" ;
392
+ public static readonly string error = "Failed to set TCL, PlayerEntity or Levitate could not be found" ;
393
+ public static readonly string usage = "tcl" ;
394
+ public static readonly string description = "Toggle noclip by turning off all collisions and activates levitate" ;
395
+
396
+ public static string Execute ( params string [ ] args )
397
+ {
398
+ PlayerEntity playerEntity = GameManager . Instance . PlayerEntity ;
399
+ LevitateMotor levitateMotor = GameManager . Instance . PlayerMotor . GetComponent < LevitateMotor > ( ) ;
400
+
401
+ if ( playerEntity && levitateMotor )
402
+ {
403
+ playerEntity . NoClipMode = ! playerEntity . NoClipMode ;
404
+ levitateMotor . IsLevitating = playerEntity . NoClipMode ;
405
+ GameManager . Instance . PlayerController . gameObject . layer = playerEntity . NoClipMode ? LayerMask . NameToLayer ( "NoclipLayer" ) : LayerMask . NameToLayer ( "Player" ) ;
406
+
407
+ return string . Format ( "Noclip enabled: {0}" , playerEntity . NoClipMode ) ;
408
+ }
409
+ else
410
+ return error ;
411
+ }
412
+ }
413
+
388
414
private static class NoTargetCommand
389
415
{
390
416
public static readonly string name = "nt" ;
0 commit comments