© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
15 replies
ZSolarDev

This function won't run for some reason

I have a function in an object thats a class named Sprite. in another class thats not an object called BaseState, It has a list of Sprites. It goes through the list of Sprites and draws these sprites to the screen, and that works fine. I tried to make a function in the Sprite class called Update, and it's supposed to log a passed argument called elapsedMilliseconds. But for some reason it doesnt log anything. I even changed it to log the text "TEST", but it still doesnt log anything. There aren't any errors, no crashes, no nothing. this is the code for handling Sprites:
for (int i = 0; i < sprList2D.Count; i++){
                    sprList2D[i].Update(elapsedMilliseconds);
                    if (sprList2D[i].visible){
                        Raylib.DrawTexture(sprList2D[i].tex, sprList2D[i].x, sprList2D[i].y, sprList2D[i].tint);
                    }
                }
for (int i = 0; i < sprList2D.Count; i++){
                    sprList2D[i].Update(elapsedMilliseconds);
                    if (sprList2D[i].visible){
                        Raylib.DrawTexture(sprList2D[i].tex, sprList2D[i].x, sprList2D[i].y, sprList2D[i].tint);
                    }
                }
Here is the Update function:
public void Update(float elapsedMilliseconds){
            Console.WriteLine("TEST");
        }
public void Update(float elapsedMilliseconds){
            Console.WriteLine("TEST");
        }
The list clearly isnt empty bc the one sprite that's there is drawing correctly. Any help?
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

Binding doesn't update for some reason
C#CC# / help
12mo ago
ImageSharp slow asf for some reason
C#CC# / help
13mo ago
query is slow for some reason
C#CC# / help
3y ago