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"

C++ Interface shows up no event when exposed to blueprint

Hello!

So, recently i started to implement a C++ Interface for damage dealing. i got the code finished and working however, no matter what i try i cant get my interface event to show up on a blueprint, it only shows (the interface ) as a function

This is my interface

 #pragma once
 
 #include "CoreMinimal.h"
 #include "WBDamageInterface.generated.h"
 
 class AActor;
 class AController;
 
 
 // This class does not need to be modified.
 UINTERFACE(Blueprintable)
 class UWBDamageInterface : public UInterface
 {
     GENERATED_BODY()
 };
 
 /**
  * 
  */
 class WOODBOUND_API IWBDamageInterface
 {
     GENERATED_BODY()
 
     // Add interface functions to this class. This is the class that will be inherited to implement this interface.
 public:
 
     UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "DamageInterface")
     void WTakeDamage(float Damage, AActor* DamageInstigator, AController* InstigatedBy, FHitResult& HitInfo);
     
     
 };

 void IWBDamageInterface::WTakeDamage_Implementation(float Damage, AActor* DamageInstigator, AController* InstigatedBy, FHitResult& HitInfo)
 {

 
 }


And this is the Character Class im adding the interface to

 #include "CoreMinimal.h"
 #include "WBDamageInterface.h"
 #include "GameFramework/Character.h"
 #include "WBCharacter.generated.h"
 
 UCLASS()
 class WOODBOUND_API AWBCharacter : public ACharacter, public IWBDamageInterface
 {
     GENERATED_BODY()
 
 public:
     // Sets default values for this character's properties
     AWBCharacter();
 
     virtual void WTakeDamage_Implementation(float Damage, AActor* DamageInstigator, AController* InstigatedBy, FHitResult& HitInfo) override;
 
 
 void AWBCharacter::WTakeDamage_Implementation(float Damage, AActor* DamageInstigator, AController* InstigatedBy, FHitResult& HitInfo)
 {
 
 
 }

All good right? However, once i fired up the editor, opened a blueprint thats a child of the WBCharacter class, the interface DOES show up but ONLY as a function, i cant implement an event for it. which is what i want to do so i can dictate how the character should react to the interface ( damage dealing)

alt text

alt text

Product Version: UE 4.16
Tags:
list.png (45.3 kB)
showup.png (11.6 kB)
more ▼

asked Mar 30 '18 at 08:59 PM in C++ Programming

avatar image

alvarofer0020
95 15 17 24

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

1 answer: sort voted first

Nevermind, i simply had to not pass the FHitResult as a reference now it works

more ▼

answered Mar 31 '18 at 12:45 PM

avatar image

alvarofer0020
95 15 17 24

(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