Video game dev bug
Hello, I am currently creating a game and I am having a problem, can someone please help me, I will send you below the 3 photos of my problems, thank you if you can help me
18 Replies
You never seem to instantiate the inventory
What should I add to solve this problem?
Create that instance
And how do I do it? Sorry I'm really new to coding
C# for beginners, chapter 3:
new Foo()
creates an instance of Foo
If you're new to C#, I'd advise against learning with Unity
$helloworldYou should start with simpler projects
with others I could create video games?
What I mean, is games are very complex, and usually require at least the basic understanding of the language you're using
Like, say, aspiring to be a world-class chef requires you to know how to hold a knife, for starters
So, it's a better idea to learn from smaller, less complex, non-game projects
And once you know C# enough, then you can get to making games
I'm not much into coding, I just want to develop a video game, if I could avoid coding I would, so I'm learning on the job.
Note that you should not do that in Unity, not to call
new Foo();
on an object inheriting UnityEngine.Object
You are missing a reference to coinCountText
Check the inspector of Inventory scriptwhere ? How do I repair it? please
When selecting the gameobject that has the script
In hierarchy
I don't really see where it is
Screenshot Unity please
Entire editor
"I'm not much into music, I just want to release an albm"
ok it's good I managed to resolve the problem with another member of the discord thank you anyway 🙂
to create instance of inventory you can use
at leas in c # coding to create instance of class you need to do that idk if that corrects for game development but try it . I am also beginner
and also make sure instead of Inventory.Instance()
you type inventory.Instance cuz when I made innstance I used lower case
also make sure to seek help from other since I gave you probably wrong answer idk you can check it tho
and the code I have just send you can use in
ontriggerEnter2D