This question was
closed May 12, 2016 at 07:59 PM by
Le-Pampelmuse for the following reason:
The question is answered
Question by
MrAwesome343 · May 12, 2016 at 06:02 PM ·
collisiontriggerracingracing game
How to let someone win in a racing game
In the racer that I'm making, there are no laps, just an end. I've tried this:
void onTriggerEnter(Collider other)
{
if (other.tag == "End")
{
SceneManager.LoadScene("P1Win");
}
}
But that didn't do anything. I tried changing it to this:
void onCollisionEnter(Collision strike)
{
if (strike.gameObject.tag == "Player1")
{
SceneManager.LoadScene("P1Win");
}
Having that script attached to the end point, but that didn't do anything either. Any advice?
Comment
I think that all the methods above should begin with capital letter: OnCollisionEnter or OnTriggerEnter.
...I have used these methods how many times now and that was the problem this one time I use it again. Thanks. It worked...