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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AddDynamic on FPSTutorial Sec.3.4 gives error

The line:

CollisionComponent->OnComponentHit.AddDynamic(this, &AFPSProjectile::OnHit);

Won't compile. It gives the errors:

Severity Code Description Project File Line Error C2664 'void TBaseDynamicMulticastDelegate ,AActor ,UPrimitiveComponent ,FVector,const FHitResult &>::__Internal_AddDynamic(UserClass ,void (__cdecl AFPSProjectile:: )(UPrimitiveComponent ,AActor ,UPrimitiveComponent ,FVector,const FHitResult &),FName)': cannot convert argument 2 from 'void (__cdecl AFPSProjectile:: )(AActor ,UPrimitiveComponent ,FVector,const FHitResult &)' to 'void (__cdecl AFPSProjectile:: )(UPrimitiveComponent ,AActor ,UPrimitiveComponent *,FVector,const FHitResult &)' FPSProject E:\Users\MikeSSD\Documents\Unreal Projects\FPSProject\Source\FPSProject\FPSProjectile.cpp 19

Severity Code Description Project File Line Error (active) no instance of function template "FComponentHitSignature::__Internal_AddDynamic" matches the argument list FPSProject e:\Users\MikeSSD\Documents\Unreal Projects\FPSProject\Source\FPSProject\FPSProjectile.cpp 19

Severity Code Description Project File Line Error MSB3075 The command ""C:\Epic Games\4.13\Engine\Build\BatchFiles\Build.bat" FPSProjectEditor Win64 Development "E:\Users\MikeSSD\Documents\Unreal Projects\FPSProject\FPSProject.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. FPSProject E:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

Product Version: UE 4.13
Tags:
more ▼

asked Sep 03 '16 at 09:03 PM in C++ Programming

avatar image

michaeljm116
16 1 2 5

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

1 answer: sort voted first

They've changed the input on the function. It is now (UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit), at least for 4.12. I haven't made the transfer yet so I'm not sure.

I was just working on collisions. You have to build the function up perfectly, or else everything will crash. it's wonderful.

As for your function, it looks good. The C++ 1st person shooter example helped me immensely with this.

more ▼

answered Sep 03 '16 at 09:24 PM

avatar image

Aericks
120 6 8 17

avatar image michaeljm116 Sep 03 '16 at 09:49 PM

Thanks! adding the UPrimitiveComponent* HitComp fixed it! :)

avatar image mcleary Oct 30 '16 at 12:30 PM

For other people interested in this, you can find the signature in the file

 Runtime/Engine/Classes/Components/PrimitiveComponent.h

It looks like this:

 DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams( FComponentHitSignature, UPrimitiveComponent*, HitComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, FVector, NormalImpulse, const FHitResult&, Hit );
(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