x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Trying to implement AISightTargetInterface. C2259 Compling error

I am not much of a C++ programmer, and when trying to inherit from AISightTargetInterface to get my AI Perception up to snuff I keep getting a compiling error about not being able to instantiate an abstract class...

I've tried my best to follow the interface tutorials and the way to few topics on this specific, but in my mind crucial (for most games) interface but I'm stuck...

alt text

What even is the _getUObject function?... I have no idea what i would override it with and why do i even have to, apart from it being a pure virtual function. it's not in the IAISightTargerInterface files as far as i can see... I've been putting off asking cause i imagine it's a C++ rookie mistake I'm making but after days of googling, trying to change the implementation, setting up new projects in other versions (this last one where the grabs are from in 4.15) i'm just stuck and am in need of help...

This is my latest attempt with a blank c++ top down template. Any help would be greatly appriciated. alt text alt text

Product Version: UE 4.15
Tags:
more ▼

asked Feb 21 '17 at 11:20 PM in C++ Programming

avatar image

ond_
1 1 4

avatar image Steve Robb STAFF Feb 22 '17 at 02:27 PM

Hi,

The _getUObject function is an implementation detail of the runtime reflection system. Code is generated for it when UnrealHeaderTool sees that your class is implementing a UINTERFACE. As this hasn't happened, I'm guessing that UHT doesn't realise your interface is a UINTERFACE.

Can you show your interface code, please?

Steve

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey,

Do you have the AIModule in your project's dependencies?

Cheers.

--mieszko

more ▼

answered Feb 22 '17 at 07:57 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image ond_ Feb 22 '17 at 08:13 PM

it was NOT, and adding it fixed it straight away! Thank you Mieszko!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question