void OnTriggerEnter2D(Collider2D col){
Vector3 pos = col.transform.position;
Set set = GetComponent<Set>();
pos.y += 28;
col.transform.position = pos;
if(col.name == ("Platform1")){
set.Set1();
}else if(col.name == ("Platform2")){
set.Set2();
}else if(col.name == ("Platform3")){
set.Set3();
}else if(col.name == ("Platform4")){
set.Set4();
}else if(col.name == ("Platform5")){
set.Set5();
}else if(col.name == ("Platform6")){
set.Set6();
}else if(col.name == ("Platform7")){
set.Set7();
}
}
nullreferenceexception - set.Set1;
Don’t know why.
I am a noob.
Sorry.
Thanks.