© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
6 replies
Sayoregg

Can't access method from one class in another even though it's set to public

Hi, I'm very new to C# and I'm currently making a small game for an assignment.
I have a class called Entity and another called EntityGroupTemplates, where I want to store a few methods that return a specific 2D array of Entity objects. The code for the templates class looks like this:
internal class EntityGroupTemplates
{
    public Entity[,] entityGroupTemplateStart()
    {
        Entity[,] template = new Entity[8, 12];

        ///Code to fill 2D array

        return template;
    }
}
internal class EntityGroupTemplates
{
    public Entity[,] entityGroupTemplateStart()
    {
        Entity[,] template = new Entity[8, 12];

        ///Code to fill 2D array

        return template;
    }
}

The issue that I am unable to call the entityGroupTemplateStart method to provide that 2D array, and I'm not sure why. I am trying to call it within the main Game1.cs (I'm using the Monogame engine for the project)
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

❔ Getting documentation from another class and putting it in another one
C#CC# / help
3y ago
❔ How to access variable from another class?
C#CC# / help
3y ago
✅ Access array in another class
C#CC# / help
4y ago