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"

Bind function to certain actors in the scene in c++

Hello, I'm looking for a way to bind OnBeginCursorOver event to certain actors in the scene.
Currently I'm trying it by going through the taged actors I need, in the BeginPlay function (also tried in the constructor) of my character and then add the event with a linked function but it seems that I can't add an function with AddDynamic. The error can be seen in the picture.

alt text

Does someone know how I could accomplish this, so that I don't need to raytrace with mouse position?

Product Version: UE 4.19
Tags:
screenshot-2.png (101.8 kB)
more ▼

asked May 08 '18 at 09:20 AM in C++ Programming

avatar image

fraxxz
18 1 8

avatar image HarryHighDef May 08 '18 at 09:26 AM

The problem I had when I got this message was that the function signature didn't match what unreal expected. Are you sure your CustomOnBeginMouseOver function matches the one it expects?

avatar image fraxxz May 08 '18 at 12:11 PM

The function I'm using is
void AGameController::CustomOnBeginMouseOver(UPrimitiveComponent* TouchedComponent)
It is the only example I found and and it seemed to work.

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

1 answer: sort voted first

You might need to switch the UPrimitiveComponent* to an AActor* in your function

more ▼

answered May 08 '18 at 12:22 PM

avatar image

HarryHighDef
1.4k 1 14 17

avatar image fraxxz May 08 '18 at 02:34 PM

Thanks, that was the solution!

(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