Collision to Destroy Actors

Non-platform specific questions.

Collision to Destroy Actors

Postby mal99 » Sat Jul 02, 2011 10:58 am

What is the best way to collide two actors to ensure both are destroyed?

I seem to have tried all the possible collision variations for each of the colliding actors - including specifying destruction of the 'event actor' and 'collide actor'. But, one or other of the actors always remains after the collision.

It doesn't matter to me when in the collision the actors are destroyed so long as they are both gone when it's over.
Would it be better to work with the 'collision finish' event?

Does it make a difference that there are up to 300 actors (moving or stationary) in play and they are very close together?

Any ideas much appreciated.

Thanks
mal99
 
Posts: 10
Joined: Tue May 31, 2011 11:47 pm
Score: 0 Give a positive score

Re: Collision to Destroy Actors

Postby skydereign » Sat Jul 02, 2011 11:11 am

This is all you should need for code. This should ensure when actor and other_actor collide, they are both destroyed.
actor -> Collision with other_actor -> Script Editor
Code: Select all
DestroyActor("Event Actor");
DestroyActor("Collide Actor");


The quantity of actors, and their proximity, shouldn't have any impact on this.

Here is an example of the above code working, since it sounds like you already tried this but it didn't work.
Attachments
collide.ged
(1.07 KiB) Downloaded 81 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Collision to Destroy Actors

Postby mal99 » Sat Jul 02, 2011 8:34 pm

Thanks. Hadn't thought of using a script to destroy both actors from one collision event.

I was trying to get each actor to destroy the other with separate collision/destroys - but I guess one actor was always destroyed a fraction before the other, so couldn't complete its destroy action.
mal99
 
Posts: 10
Joined: Tue May 31, 2011 11:47 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest