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"

Why do I get UFUNCTION() Unrecognized types?

Hey,

I'm getting unrecognized type 'CustomUserType' when I add something like this to one of my actors:

 UFUNCTION()
 void SomeEventName(CustomUserType* someVariable);

Some types do work though, for example if we used FRotator instead of CustomUserType* then everything is fine.

What do I need to do here?

Thanks

Product Version: Not Selected
Tags:
more ▼

asked Jun 07 '14 at 11:44 AM in C++ Programming

avatar image

Maddius
146 14 19 24

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Your class been not registered by UHT and when UHT reach this point it does not know how to generate things for your class, something is missing in your class... and i don't know exactly what :p but i can give you hints

  • First of all, all classes and structs beyond UObject class tree should have "F" prefix by UE4 convention, UHT may require that

  • You could try adding UCLASS() before your FCustomUserType class declaration , #include "CustomUserType.generated.h" and GENERATED_UCLASS_BODY() inside class in it's header file

  • Structs works for sure, so if you got vables only class, make it struct instead... you can actually try to add functions to struct too, but they mos likely won't work with Blueprint. But remember same as classes it need USTRUCT(), GENERATED_USTRUCT_BODY(), generated header file include and also need to have "F" prefix in the name

  • In 4.3 there will be option in "Add Code to Project" which allows to create non-UObject classes which should supply class with everything you need.

  • Forgot to say, you dont really need to use UFUNCTION () as long as you dont want to use its features and you dont really need function to be seen by engine (like binding delegates to that funtion)

more ▼

answered Jun 07 '14 at 02:31 PM

avatar image

Shadowriver
34.5k 917 164 1094

(comments are locked)
10|2000 characters needed characters left
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