set g_sandbox_editor_distance_edit 350 "distance at which players can edit or remove objects they are looking at"
set g_sandbox_object_scale_min 0.1 "minimum scale that objects can be set to"
set g_sandbox_object_scale_max 2 "maximum scale that objects can be set to"
-set g_sandbox_object_matvel 50 "velocity objects must have while coliding for material effects to be applied"
+set g_sandbox_object_matvel 200 "velocity objects must have while colliding for material effects to be applied"
seta menu_sandbox_spawn_model "" // used to store the model in the input field
seta menu_sandbox_edit_skin 0
}
}
+.float touch_timer;
void sandbox_Object_Touch()
{
+ // apply material impact effects
+
+ if(self.touch_timer > time)
+ return; // don't execute each frame
+ self.touch_timer = time + 0.1;
if not(vlen(self.velocity) >= autocvar_g_sandbox_object_matvel || vlen(other.velocity) >= autocvar_g_sandbox_object_matvel)
- return;
+ return; // impact not strong enough
switch(self.material)
{