Video is outdated in how to enable replication

This video is a bit outdated, as you can now set replication to enabled on the constructor by using

{
	PrimaryActorTick.bCanEverTick = true;

	// The new way
    bReplicates = true;
	SetReplicatingMovement(true);

	SetMobility(EComponentMobility::Movable);
}

void AMovingPlatform::BeginPlay()
{
	Super::BeginPlay();

    // The old way now commented out

	// if (HasAuthority())
    // {
	//     SetReplicates(true);
	//     SetReplicateMovement(true);
	// }
}
1 Like

Is it not necessary to check the Authority first to filter server from client anymore?

I think it probably doesn’t matter if they are set client side.

I tried it this way and couldn’t get the cube to move, the old way worked for me tho…

I think is not needed to use the Authority because I tried to put the code lines without the if to check the error and it worked perfectly.

At least in Unreal 5