Hi,
I’m starting with unity and i have some questions.
Is it better to check for collision in Player or in prefabs Coin ? (The player can catch coins.)
Player :
void OnTriggerEnter2D(Collider2D obj)
{
switch (obj.tag) {
case "Coin":
Destroy(obj.gameObject);
Global.score++;
break;
}
}
Coin :
void OnTriggerEnter2D()
{
Destroy(gameObject);
Global.score++;
}
And in the seconde case it increases score by 2. I guess because it takes both player and Coin but is there a mean to trigger this script only once when collision ?
(Edit : Ok for this one, I thaught that unthicking a script would desactivate it )
Is it bad for performance to let empty functions like : update{ } ?
Is there a mean to show errors in MonoDevelop ?
Why when a block is quite fast, it can pass through other rigid blocks ?
Thanks !
Have a nice day !