C
C#11mo ago
Owltávio

Trying to create objects using a loop, but don't know what i'm doing wrong?

so i'm trying to update my turtle race simulator using tasks, one of the changes is to be able to choose the number of turtles participating in the race using a loop, but I keep getting the compile error CS0120, could anyone explain what I'm doing wrong?
4 Replies
Zendist
Zendist11mo ago
Show the code 😊.
Owltávio
OwltávioOP11mo ago
BlazeBin - fmfwyxkuoonb
A tool for sharing your source code with the world!
Zendist
Zendist11mo ago
i.Register() instead. You're trying to use Register() like a class method (static) and not calling it on the instance.
Owltávio
OwltávioOP11mo ago
oh okay Thanks, it worked.

Did you find this page helpful?