05-07-2014, 06:12 PM
Hey everyone! i sitting here with an annoying problem :/
I have made some birds(modelled, and imported them as staticprops), but whenever i try to make them move continously, they just do'nt seem to be going anywhere :/ i get no errors or nothing, and all the birds are called :/ Help is gladly appreciated
The code:
I have made some birds(modelled, and imported them as staticprops), but whenever i try to make them move continously, they just do'nt seem to be going anywhere :/ i get no errors or nothing, and all the birds are called :/ Help is gladly appreciated
The code:
Code:
void OnStart(){
//Variables
AddLocalVarInt("MoveBirdsInt", 1);
//Colliders
AddEntityCollideCallback("bird_1", "StopBirds", "StopMoveBirds", true, 1);
//Timers
AddTimer("MoveBirdsBuilding", 0, "MoveBirds");
}
void MoveBirds(string &in asTimer){
if(GetLocalVarInt("MoveBirdsInt") < 50){
AddPropForce("bird_1", -5000.0f, 0, 0, "world");
AddPropForce("bird_2", -5000.0f, 0, 0, "world");
AddPropForce("bird_3", -5000.0f, 0, 0, "world");
AddPropForce("bird_4", -5000.0f, 0, 0, "world");
AddPropForce("bird_5", -5000.0f, 0, 0, "world");
AddPropForce("bird_6", -5000.0f, 0, 0, "world");
AddPropForce("bird_7", -5000.0f, 0, 0, "world");
AddPropForce("bird_8", -5000.0f, 0, 0, "world");
AddPropForce("bird_9", -5000.0f, 0, 0, "world");
AddPropForce("bird_10", -5000.0f, 0, 0, "world");
AddPropForce("bird_11", -5000.0f, 0, 0, "world");
AddPropForce("bird_12", -5000.0f, 0, 0, "world");
AddTimer("MoveBirdsRe", 0.1f, "MoveBirds");
}
}
void StopMoveBirds(string &in asParent, string &in asChild, int alState){
SetLocalVarInt("MoveBirdsInt", 50);
}