function OnTriggerEnter2D(obj) {
var name = obj.gameObject.name;
if (name == “bullet(Clone)”) {
Destroy(gameObject);
Destroy(obj.gameObject);
}
if (name == “spaceship”) {
Destroy(gameObject);
}
and i cant get an game object from obj.
I got bla bla… GameObject is not member of object, and if i using obj not working too.
Seems like here is unity strongly bugged.
You need to have a look at the doc, because what you have is not right. Your function parameter doesn’t declare a type.
Unity isn’t bugged, just follow the example and declare your type and it will be fine.
If you’re doing the space shooter demo, you can look at their code here.