Instance of actor not re-creating [Solved]

Northfield82

  • Posts: 649
I have created an Actor type 'Knight', which when collides with my Player Actor, a 'Sword Actor' is created for the Knight and an animation is played of the Sword swinging.  I am using an 'is animation still playing' to determine when to 'kill the Sword' so only one instance is created and it disappears once the animation loop is finished (if there is no longer a collision). 

The problem I have is the Sword Actor only re-creates for one instance of the Knight Actor. It re-creates fine over and over again for the other Knight, but of one of the Knights, once the Sword Actor is killed it doesn't return. (2 Knights are on scene)

See code below, thanks

« Last Edit: December 28, 2014, 07:01:26 am by Northfield82 »

LIBERADO

  • *
  • Posts: 2720
 ;) Hello!

Your code is unnecessarily complicated, it has unnecessary boolean attributes.
For your purpose, you only need the Each_Sword actor attribute, in this way:

« Last Edit: December 28, 2014, 06:08:23 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Northfield82

  • Posts: 649
Brilliant!  Only issue now is they tend to leave the sword behind a little if after the sword animation has started the Knight moves into a different position via the collision.  Have I used the best method of attaching the Sword to the Knight?

LIBERADO

  • *
  • Posts: 2720

Have I used the best method of attaching the Sword to the Knight?
Use the same code with this different distribution of the blocks:

« Last Edit: December 28, 2014, 06:51:43 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Northfield82

  • Posts: 649
Amazing! Would you mind explaining to me what difference that made?

LIBERADO

  • *
  • Posts: 2720
Amazing! Would you mind explaining to me what difference that made?
When the "set x to..." and "set y to..." blocks are placed inside the always Event, the Sword coordinates are continuously updated to match the Knight coordinates.

« Last Edit: December 28, 2014, 07:16:07 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Northfield82

  • Posts: 649
Gotchya! Thank you very much for your help today.