© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
7 replies
MRW419

❔ What is the problem with this code?

switch (layer)
        {
            case Layer.Foreground;
            return speed * 1;
            case Layer.Middleground;
            return speed * 0.5f;
            case Layer.Background;
            return speed * 0.1f;
            default;
            return speed * 1;
           
        }
switch (layer)
        {
            case Layer.Foreground;
            return speed * 1;
            case Layer.Middleground;
            return speed * 0.5f;
            case Layer.Background;
            return speed * 0.1f;
            default;
            return speed * 1;
           
        }
image.png
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

✅ What is wrong with this code???
C#CC# / help
17mo ago
what is wrong with this code
C#CC# / help
2y ago
what is wrong with this code?
C#CC# / help
4y ago