Announcement

Collapse
No announcement yet.

Weird problem: Unrecognized type FLifetimeProperty

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

    Weird problem: Unrecognized type FLifetimeProperty

    Hello everyone,

    I have weird problem with function GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const

    Here's the header code:
    Code:
    UFUNCTION()
    		virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const override;
    And this is the error with cpp code:
    Click image for larger version

Name:	strange.PNG
Views:	1
Size:	25.4 KB
ID:	1142470

    Is there something I have misspelled? Or I have to include any header files?
    Raise the Black Flag!

    - [TUT]: HTTP GET Request in C++
    - [Tool]: Game Site Tracker website for your project
    - [Website]: Website for my game Leviathan

    #2
    Just a quick guess, but try including this at the top of your .cpp file:

    #include "Net/UnrealNetwork.h"

    Comment


      #3
      Just tried to add it.. the same error:
      Raise the Black Flag!

      - [TUT]: HTTP GET Request in C++
      - [Tool]: Game Site Tracker website for your project
      - [Website]: Website for my game Leviathan

      Comment


        #4
        I could be wrong and it may not be relevant to the error but I believe you don't need to define the GetLifetimeReplicatedProps function in the header as the Unreal back-end automatically does it.

        Comment


          #5
          Just removed it and Visual Studio says: Inherited member not allowed
          Raise the Black Flag!

          - [TUT]: HTTP GET Request in C++
          - [Tool]: Game Site Tracker website for your project
          - [Website]: Website for my game Leviathan

          Comment


            #6
            Is your Health variable marked as replicated in the header? If no variables are marked as replicated it won't automatically generate the function.

            Like so:

            Code:
            UPROPERTY(replicated)
            float Health;

            Comment


              #7
              Yeah that worked. Thanks But now I have to start a new thread about why my player does not get killed in multiplayer
              Raise the Black Flag!

              - [TUT]: HTTP GET Request in C++
              - [Tool]: Game Site Tracker website for your project
              - [Website]: Website for my game Leviathan

              Comment

              Working...
              X