I wrote the code in Lecture 63 where I wrote a Timer timer but it gave me this error. What is the problem and how should I fix it?
Hi Bboo7,
Welcome to our community!
Thanks for sharing the screenshot. That’s helpful. In this case, the error message tells us what the problem is: There is a name conflict.
According to the error message, you have System.Threading.Timer
and UnityEngine.Timer
in the scope of your class. The class we wrote is UnityEngine.Timer
.
Check the top of your code. Maybe the System.Threading
namespace was added there. Visual Studio Code sometimes adds namespaces there, which could result in a conflict. Remove using System.Threading;
from your class, and save your script.
Remember you can also look at the lecture code changes via the link in the Resources of each lecture.
Did this fix it?
See also:
- Forum User Guides : How to mark a topic as solved
I solved it!. Thank you very much Nina.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.