This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
I can't get a WidgetComponent working in C++ to save my life
Post Body

I'm trying to add a widget component to an enemy script of mine to display health bars, etc. I've done the standard thing where I forward declare the UWidgetComponent header in my EnemyTemplate.cpp, then create a pointer to a new UWidgetComponent in the EnemyTemplate.h.

When I do this, however, it gives me errors saying "unexpected token(s) preceding ";"", or "syntax error: missing ';' before '*'" Whenever I try bringing the UWidgetComponent #include statement into the header, it creates a new host of errors, some incomprehensibly long nonsense about "unresolved externals."

Does anyone know why UWidgetComponent is so fickle, and how to fix this?

Author
Account Strength
100%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
9,835
Link Karma
5,358
Comment Karma
4,403
Profile updated: 3 days ago
Posts updated: 1 week ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 months ago