C
C#2mo 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
Zendist2mo ago
Show the code 😊.
Owltávio
Owltávio2mo ago
BlazeBin - fmfwyxkuoonb
A tool for sharing your source code with the world!
Zendist
Zendist2mo 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ávio2mo ago
oh okay Thanks, it worked.