x


Collision detection of certain ojects

I could not find any info for detecting collision between two (or more) certain objects. For instance;

detect if x collides y then destroy y

how is it possible to write such code,I could not find any info for detecting collision between two (or more) certain objects. For instance;

detect if x collides y then destroy y

how is it possible to write such code

edit------------------

i figured out some things about it, but now the question is how can i detect collision of instantiated prefab?

more ▼

asked Apr 28 '12 at 12:05 PM

srcn gravatar image

srcn
20 2 2 4

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

prefabs are instantiated with the name prefab(copy), so using

if(collision.gameobject.name == "prefab(copy)") should detect it.

more ▼

answered Apr 28 '12 at 01:53 PM

MangoDerp gravatar image

MangoDerp
109 2 2 5

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2584
x326
x181
x7

asked: Apr 28 '12 at 12:05 PM

Seen: 687 times

Last Updated: Apr 28 '12 at 01:53 PM