❔ I just can't even start to think what has gone wrong.
I get an null reference on
tankTwo = new Tank()
. I am starting to think I have wrong version of dotnet or something. My version right now is 6.0.401
, is there any fault with this one?13 Replies
I hope it's ok to send project file here
NOTE: I am using MonoGame framework in this project.
nobody going to download a .rar.
Use $paste, myabe
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
because its an "override", then the global vars are not accessible in the compiled version
it overrides an existing function
Make the variables accessible by putting it in the correct scope
I would, but too many files for that
Could you elaborate?
your
private GraphicsDeviceManager _graphics;
its private, try do the same with the Tankjust add private before tank? I tried that. doesn't seem to change anything
else try to initialize it in the global scope
aka
Might work, never used XNA before so im not entirely sure
problem is, There are
tankOne
and tankTwo
.
tankOne = new Tank();
comes first and works.
tankTwo = new Tank();
comes right after it, but doesnt work.
tried that. scope doesn't seem to change anythinghm good question
Not an expert in XNA, but check if you have tankOne defined somewhere else in the code (and tankTwo is not)
It might be referencing to some other place by mistake
i checked every difference that could have happened, but they both seem to follow same path
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.