Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Why wont my gameObject destroy?

Hello, im very new to this coding stuff and im trying to learn it. I try to make a very easy game where you basically just press on a box and it is supposed to be destroyed but for some reason it throws me an error. Does someone know of an easy fix?


I left a gyazo of my code below. I appreciate all answers 🙂


Best Answer

  • MouledouxMouledoux Member
    edited July 28 Accepted Answer

    GameObject with a capital 'G' is the type, or class that a gameObject is.

    gameObject with a lowercase 'g' is the object that this component belongs to.


    edit: changed wording for clarity.

Answers

  • SplewSplew Member

    It worked, thanks 😁 By changing from private static void to just void and change the g to lowercase worked.

  • I didn't even notice the static part. Great job!

Sign In or Register to comment.