© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
11 replies
Demite

✅ Object is null after initializing

Hello, I have a object I make
WorldRegions region = new WorldRegions(i, 1)
{
RegionStartTile = startTile,
Width = randomXSize,
Height = randomYSize
};

Yes this object is null when referenced, and null when in watch in debug. I'm not sure why anyone able to explain what is happening?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Initializing an object
C#CC# / help
3y ago
✅ Object Reference is null, even with try/catch
C#CC# / help
10mo ago
❔ Object reference set to null
C#CC# / help
3y ago
Initializing self made class as array fills it with null [Answered]
C#CC# / help
4y ago