Helper/TransformExtension.cs

Extension methods for Sandbox.Transform. Adds a Translate(this Transform, int x=0, int y=0, int z=0) that increments the transform position components by the given integer amounts.

🐞 Translate operates on a copy of Transform since Transform is a struct, so changes to Position are lost and the caller’s Transform is not updated.
using Sandbox;

public static class TransformExtension
{

	public static void Translate(this Transform t, int x = 0, int y = 0, int z = 0)
	{
		t.Position.x += x;
		t.Position.y += y;
		t.Position.z += z;
	}

}