// on error = my.x - 50 != behind pos
// example only: This code SHOULD NOT work.
var behind_v[3] = {0,0,0}; // reusable
action cube_fall() {
//Put random physics code or whatever you want the cube to do in here, this will be the cube's behavior.
}
action player_a() {// Behavior assigned to the player
var kin_create; kin_create = 0;
while(1) {
if (key_enter == 1 && kin_create == 0) { //& not pressed last frame
vec_for_angle(behind_v, vector(ang(my.pan - 180), 0, 0));
vec_scale(behind_v, 50);
ent_create("cube.mdl", behind_v, cube_fall); // creates the cube 50 quants behind the player and assigns its behavior.
}
}
kin_create = key_enter; // key_enter pressed last frame?
wait(1);
}