Hello everyone, I am working on this game where you shoot an airplane with a missile. Yea its pretty generic right now but I'm working on it haha. Let me put in my code before I go any further.

#include <acknex.h>
#include <default.c>

var earthgravity[3]= 0,0, -386;
var launch_angle= 45;

function missile_flying()
{
while (1)
{
my.roll = my.roll + 3;
wait(1);
}
}

function main()
{
level_load ("PhysicsTest.wmb");
wait (2);
while (1)
{
launch_angle += key_cuu * .05;
launch_angle -= key_cud * .05;
wait(1);
}
}

action ball_drop()
{
while (key_space == 0) {wait (1);}
phent_settype(my, PH_Rigid, PH_box);
phent_setmass (my, 2, PH_box);
ph_setgravity (earthgravity);
phent_addvelcentral(my, vector(0, -472 * cos(launch_angle) , 472 * sin(launch_angle) ) );
function missile_flying();
wait(1);
}

action plane_fly()
{
while (key_space == 0) {wait (1);}
phent_settype(my, PH_Rigid, PH_Box);
phent_addvelcentral (my, vector(0, -472*cos(45), 0) );

}

Ok I have the code set up so that while the user is not pressing space, the action waits. Then when the spacebar is pressed the missile launches, as well as the plane.

The problem is that I want the missile to rotate, but if I put the my.roll = my.roll + 3; into the action ball_drop, it does not work. So I made it into a function and tried to call it when the missile launches.

I get an error saying empty function. I also want to work around the tilt modifier and what not, but it seems to be that I either have an action where the missile rolls, or one where it launches and can't get them to work simultaneously.