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"

Cannot get AddDynamic to work

I am new to UE4 and I am following the first person shooter tutorial and it says to have this line of code` CollisionComponent->OnComponentHit.AddDynamic(this, &AAmmo::OnHit);` However, I get a red line under the "." before AddDynamic and in the error window in visual studio, I get this(See Picture) link text

I don't know what to do and if there is another way to do this

Product Version: UE 4.13
Tags:
more ▼

asked Dec 17 '16 at 11:13 PM in C++ Programming

avatar image

TAHIRM14
1 1 2 1

avatar image drew767 Dec 18 '16 at 10:50 AM

I have the same problem:


h file UFUNCTION() void TriggerEnter( AActor OtherActor, UPrimitiveComponent** OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);


cpp file
Root->OnComponentBeginOverlap.AddDynamic(this, &AMyActor::TriggerEnter);


error ...MyActor.cpp:16:35: No matching member function for call to '__Internal_AddDynamic'

Root->OnComponentBeginOverlap.AddDynamic(this, &AMyActor::TriggerEnter);

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

1 answer: sort voted first
more ▼

answered Dec 18 '16 at 10:54 AM

avatar image

drew767
1 1 1

avatar image TAHIRM14 Dec 18 '16 at 05:46 PM

The error seems to go away after i copied the text from the link(See pictures) however I am now getting another error in which you can see in the picture. I am an administrator so IDK why I am getting an error like that http://i.imgur.com/wqOQHGA.png

avatar image drew767 Dec 18 '16 at 10:34 PM

I am not sure, but I think that mixed order of parameters.

try this one UFUNCTION() void OnHit(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);

and delete all other

avatar image TAHIRM14 Dec 24 '16 at 04:54 PM

sorry for late reply but I tried it and I got these errors instead

http://i.imgur.com/teJqvQD.png

(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