Page 1 of 1

actor destroy when punched

PostPosted: Wed Aug 25, 2004 10:59 pm
by Hen
hi there im relatively new to this though i have been through all the tutorials. I have made an actor (jon) destroy another actor (player) on collision. but i would like player to destroy jon if player is punching.

I do not know too much about visual basic code ar anything like it but i came up with this

if ("player") .animindex = ("punch")
then Destroyactor("jon")

please could anyone help?

PostPosted: Thu Aug 26, 2004 6:33 am
by jazz_e_bob
Your logic is fine. Here's how to do it the GE way. :wink:

This function needs to be placed at the point where player collides with jon.

So:

On Player Event Collision (anyside of jon)

if ( player.animindex == 2 ) // punch animation
DestroyActor("Collide Actor"); // destroy jon

jazz

:)

PostPosted: Fri Aug 27, 2004 9:02 am
by Hen
it doesn't seem to work,

jon just destroys player even if he punches, have i typed it in the wrong action?

should i make it a conditional action?

PostPosted: Sun Aug 29, 2004 3:15 am
by hobgoblin
why don't u just creat and actor jon_punching

then when you push the key, destroy jon, create jon_punching, animation fininsh, destroy jon_punching and create jon

then the bad guy will be destroyed when he colides with jon_punnching not jon