Hi,
My code looks almost identical (seems like CoPilot is pulling code suggestions from the repo, to be honest). But I see the object moving on both client and server for some reason.
// Fill out your copyright notice in the Description page of Project Settings.
#include "MovingPlatform.h"
AMovingPlatform::AMovingPlatform()
{
PrimaryActorTick.bCanEverTick = true;
SetMobility(EComponentMobility::Movable);
}
void AMovingPlatform::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (HasAuthority())
{
FVector Location = GetActorLocation();
Location += FVector(Speed * DeltaTime, 0, 0);
SetActorLocation(Location);
}
}
void AMovingPlatform::BeginPlay()
{
Super::BeginPlay();
if (HasAuthority())
{
SetReplicates(true);
SetReplicateMovement(true);
}
}