public class Exit : MonoBehaviour {
public GameObject pl1;
public GameObject pl2;
public Transform pl1v;
public Transform pl2v;
void Start () {
}
public BeenClicked () {
pl1.transform.position = pl1v.position;
pl2.transform.position = pl2v.position;
}
}
Where’s OnClick function? I don’t see it. How can you say something’s not working when you don’t show a screenshot of the OnClick function in the editor?
add the script to your button then in the button
go to onclick() then click the + icon
drag the button(the one in which the script is added) in it
and then-
NoFunction–>Button(attached script) → select the function BeenClicked()