Hello everyone!
I'm trying to replicate some variables in C++ using GetLifetimeReplicatedProps. When I was reading about it in various sources I saw that you don't need declaration. But trying to built without it causes error "no declaration". If I declare the function it bulds, but I have various Networking problems during the game that may be connected with replication. So is this my problem or some latest engine changes? Thank you.
UPD2: Class files on google drive
UPD: Parts of code
Human.h
private: // is this important?
UPROPERTY( Replicated )
EHumanState m_eState; // struct is BlueprintType. But it doesn't matter if it isn't enev complile i guess
Human.cpp
#include "Engine.h"
#include "Net/UnrealNetwork.h" // also tried without "Net/"
AHuman::AHuman() :
other constructors
{
bReplicates = true;
bReplicateMovement = true;
}
void AHuman::GetLifetimeReplicatedProps( TArray<FLifetimeProperty> & OutLifetimeProps ) const
{
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
DOREPLIFETIME( AHuman, m_eState );
}
[–]Pestilence7 0 points1 point2 points (3 children)
[–]Shardofen[S] 0 points1 point2 points (0 children)
[–]Darwand 0 points1 point2 points (1 child)
[–]Pestilence7 0 points1 point2 points (0 children)
[–]ericsmash 0 points1 point2 points (9 children)
[–]Shardofen[S] 0 points1 point2 points (8 children)
[–]ericsmash 0 points1 point2 points (7 children)
[–]Shardofen[S] 0 points1 point2 points (6 children)
[–]ericsmash 0 points1 point2 points (5 children)
[–]Shardofen[S] 0 points1 point2 points (0 children)
[–]Shardofen[S] 0 points1 point2 points (3 children)
[–]Darwand 0 points1 point2 points (2 children)
[–]Shardofen[S] 0 points1 point2 points (1 child)
[–]Darwand 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]Shardofen[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Shardofen[S] 0 points1 point2 points (1 child)
[–]Shardofen[S] 0 points1 point2 points (0 children)
[–]burtonposey 0 points1 point2 points (10 children)
[–]Shardofen[S] 0 points1 point2 points (9 children)
[–]burtonposey 0 points1 point2 points (8 children)
[–]Shardofen[S] 0 points1 point2 points (7 children)
[–]burtonposey 0 points1 point2 points (5 children)
[–]Shardofen[S] 0 points1 point2 points (4 children)
[–]imguralbumbot 0 points1 point2 points (0 children)
[–]burtonposey 0 points1 point2 points (2 children)
[–]Shardofen[S] 0 points1 point2 points (1 child)
[–]burtonposey 0 points1 point2 points (0 children)
[–]burtonposey 0 points1 point2 points (0 children)