making sprite scale increase on collision with other sprite
Hi I have a sprite(BasicBlob) and I'm trying to make it so that when the sprite collides with another different sprite(Phosphorous basic) the Phosphorous sprite is destroyed and the BasicBlob sprite scale is increased by 1 I have got this to work however once it has collided with one phosphorous sprite it doesn't increase the scale of the BasicBlob sprite again but the phosphorous sprite does disappear
void OnCollisionEnter2D(Collision2D coll)
{
if (coll.gameObject.tag == "Phosphorous")
{
Destroy(coll.gameObject);
}
if(coll.gameObject.tag == "player")
{
coll.gameObject.transform.localScale += new Vector3(1, 0, 1);
}
}
no error message is shown
Comment
Your answer
Follow this Question
Related Questions
Object do not stop after collision 0 Answers
Get tile from trigger 0 Answers
[Problem]Collider Issues when Sprites Meet 2 Answers
My sprite size changes between animations? 4 Answers
how make the coin not increased when the player touch them more than one? 1 Answer