© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
eulerfan40

Syntax Error in for loop.

Guys, I have no idea why I'm getting these syntax errors from this code. I know I probably look like an idiot and this is something really simple but I just can't see what wrong with it XD
for (int i = 0; i < playerLives; i++;)
        {
            Instantiate(heart, heartContainer, false);
        }
for (int i = 0; i < playerLives; i++;)
        {
            Instantiate(heart, heartContainer, false);
        }

Errors: (26,45): error CS1026: ) expected
(26,46): error CS1513: } expected
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

for loop casuing error
C#CC# / help
3y ago
✅ syntax error
C#CC# / help
2y ago
✅ Syntax Error
C#CC# / help
2y ago