Download

Extending from UInterface

While this issue is likely due to something really stupid I completely overlooked, I cannot seem to find a way to extend from the UInterface class.

I found a bunch of tutorials on how to implement C++ interfaces (specifically the one by Rama), but the tutorial never actually mentioned how to extend
from the interface class. So, I expected it to be like how you would normally extend from classes, but when trying to add a new class to the project, I cannot
find the interface class at all. Even when selecting all classes, the only interface classes I get are UI, Material and a bunch of others. No interface though.

I have also tried to just add it manually to Visual Studio, using another tutorial on how to add C++ files to Unreal through Visual Studio, but that just caused
my game to become corrupt or something (right now it freezes the moment I start moving in the editor, when before adding the classes manually, I didn’t have any
problems. Currently rebuilding the entire thing to see if that solves it).

So, how do I extend from a UInterface class? I am using 4.8.1 by the way.

In 4.7 I’ve done it by just using Rama’s tutorial, which I’m sure you’ve seen:

As for how to create a class to get started, you can just create a blank class to start with (from the content browser in the editor) and then replace the .h and .cpp code with whatever you want. Extend from UObject or something.

Regarding your browser freezing - I’ve found it best to start the editor with the default map that doesn’t include any classes or objects from my custom code. That way if there is an error in the level I’m working on because I’ve messed the code up, I can still start the editor and try and undo it.

Yeah, that’s why I mentioned I was using Rama’s tutorial :wink:

But thanks, as expected I completely overlooked the blank class option since I was too busy trying to search for the interface class. Got the interface class up and running.
The other problem was caused by an error that slipped in with a previous build and the rebuild option did indeed solve it.