Search Unity

Question 2D Destroy Collision Script

Discussion in '2D' started by QuartzCZ, Jul 27, 2021.

  1. QuartzCZ

    QuartzCZ

    Joined:
    Jul 27, 2021
    Posts:
    8
    Může mi někdo pomoct z tímhle scriptem?
    Translation: Can anyone please help me with this code?
    upload_2021-7-27_11-41-29.png
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,478
    The compiler is telling you what's wrong there and it's highlighted. The "OnCollisionEnter2D" doesn't have a method body enclosed with "{ }" braces (it only has a semi-colon). The same as your "Update" function.

    This isn't 2D related, it's basic C# syntax.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,478
    NOTE: You duplicated this post here.