So I’m having trouble adding code to my project. For no apparent reason, when I try to add code to my “MyFirst2DGame” project (via File > Add Code to Project), it displays this error:
“Failed to add class GravityTrigger. Failed to automatically hot reload the ‘MyFirst2DGame’ module.”
When I close that message, in the class adding dialog, it shows the error: “The name ‘GravityTrigger’ is already used by another class.” I checked before I tried to add the code that the word “Gravity” never appeared in my project folder.
When I look in Visual Studio, it has indeed added GravityTrigger.h and GravityTrigger.cpp. In the C++ Classes section of the content browser, GravityTrigger is missing. When I added GravityTrigger, the parent class was a TriggerBox. This error doesn’t happen when I try to add GravityTrigger as a child of Actor.
How do I fix this issue so I can add a TriggerBox correctly?