C
C#β€’4mo ago
Ev4Y4n

Merge objects game

I'm trying to make a merge minigame but there's an error which I'm not able to fix. I've beentrying for days now.😫 If anyone knows how to solve this error I would greatly appreciate it.πŸ™
No description
No description
6 Replies
SinFluxx
SinFluxxβ€’4mo ago
It's saying the Length parameter you're passing to the Substring method (you're passing name.IndexOf("_")) cannot be less than 0. Which means that name.IndexOf("_") is returning a value <0, i.e, it's not finding any _ within name
Ev4Y4n
Ev4Y4nβ€’4mo ago
And why can this error occur? Because I've been looking for it for days but I can't find a solution.
SamwiseTheBrave
SamwiseTheBraveβ€’4mo ago
As SinFluxx has said, it doesnΒ΄t find '_' in the name. IndexOf returns index of first occurrence of character in string. If it doesn't find any, it returns -1.
Ev4Y4n
Ev4Y4nβ€’4mo ago
So I need to change the "_", right?
SamwiseTheBrave
SamwiseTheBraveβ€’4mo ago
you need to place it somewhere in your object's name because it doesn't seem to be present there
Ev4Y4n
Ev4Y4nβ€’4mo ago
Okay thank you both! I'm gonna try fix it.
Want results from more Discord servers?
Add your server
More Posts