|
5 registered members (AndrewAMD, SBGuy, Petra, flink, 1 invisible),
699
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Kill function does not work
#381162
08/24/11 18:59
08/24/11 18:59
|
Joined: Jul 2010
Posts: 974 United Arab Emirates, Dubai
TheShooter
OP
User
|
OP
User
Joined: Jul 2010
Posts: 974
United Arab Emirates, Dubai
|
Hi, I have some spikes. When the ball collides with them, the ball shall get removed. But it falls through the spikes. Here my action code:
var abstand;
ENTITY* ent_piekser;
function kill()
{
while(1)
{
abstand = vec_dist(ent_piekser, ent_ball);
if(abstand = 0)
{
ent_remove(ent_ball);
return;
}
wait(1);
}
}
action piekser()
{
ent_piekser = me;
kill();
}
piekser = spikes. abstand = distance I included it in the main, and set the action in WED to the model. Whats the problem here? regards, TheShooter
Last edited by TheShooter; 08/24/11 18:59.
|
|
|
Re: Kill function does not work
[Re: TheShooter]
#381172
08/24/11 20:36
08/24/11 20:36
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
action piekser()
{
while(!ent_ball);
wait(1);
while(vec_dist(ent_piekser, ent_ball) > 0.01)
wait(1);
ent_remove(ent_ball);
}
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|
|
|