"Role" undeclared identifier in UObject class

Hi.

I have a UObject class for my Weapon class in my game.

But here it says ‘Role’ undeclared identifier

![alt text][1]

Right now you are subclassing the UObject type.
It is likely that you want to subclass the AActor type instead.

UObject does not come with the functionality for a network role or for placement in the world.
If you change your subclass to AActor, you will be able to use the Role variable.

If you like, you may ask how to add a network role to a uobject yourself but Saruman might say “you have elected the way of pain!” :slight_smile:

Actually I removed my UObject class and my project broke. Now i have to recompile the Engine GitHub source and recreate the project. Thanks UE4, very professional.

Yeah, this is a common feature of engines that generate code to manage reflection and delegation. It’s terribly annoying, but it’s one of the best ways to manage the problem.

Oh wait, you removed UObject from the engine source?

No. I removed the .h and .cpp files from the Disk and the Engine kept giving me compiling errors. I knew I had to remove all the references to that class inside the other classes/files. I did, but for some reason the original .exe of the Engine (not of the project) disappeared from its folder and I had to recompile…
I solved anyway.