Announcement

Collapse
No announcement yet.

AActor::ReceiveHit in 4.8...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    AActor::ReceiveHit in 4.8...

    AActor::ReceiveHit in 4.8 is not virtual any longer. Is that a bug or by design? How can I override ReceiveHit ?

    #2
    Originally posted by Jetpic View Post
    AActor::ReceiveHit in 4.8 is not virtual any longer. Is that a bug or by design? How can I override ReceiveHit ?
    Not sure here is the commit that removed the virtual https://github.com/EpicGames/UnrealE...c35298e76L1099

    Ah here it is

    Code:
    virtual void NotifyHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit);

    Comment


      #3
      Yeah they've all changed to 'Notify' now, same for Overlaps too.

      Comment


        #4
        BlueprintImplementableEvents cannot be virtual, there is a handful of issues if they are declared virtual and BlueprintNativeEvents are what should be used for cases where you want both C++ and Blueprints to be able to override the behavior.

        In this particular case there was already a different C++ function that is virtual that you should use to override which is NotifyHit and then ReceiveHit is where a blueprint would insert its reactions.

        Apologies for the inconvenience, it was definitely a big change that will require adjusting and no way of providing backwards compatibility, but it was a necessary one.

        Comment


          #5
          Originally posted by Marc Audy View Post
          BlueprintImplementableEvents cannot be virtual, there is a handful of issues if they are declared virtual and BlueprintNativeEvents are what should be used for cases where you want both C++ and Blueprints to be able to override the behavior.

          In this particular case there was already a different C++ function that is virtual that you should use to override which is NotifyHit and then ReceiveHit is where a blueprint would insert its reactions.

          Apologies for the inconvenience, it was definitely a big change that will require adjusting and no way of providing backwards compatibility, but it was a necessary one.
          What about ReceiveRadialDamage?I can't find NotifyRadialDamage.

          Comment


            #6
            Originally posted by ayconanw View Post
            What about ReceiveRadialDamage?I can't find NotifyRadialDamage.
            You can override AActor::TakeDamage and filter on DamageEvent.IsOfType(FRadialDamageEvent::ClassID).

            Comment

            Working...
            X