No owning connection for actor

Hi,

Il followed the first part of this tutorial:

however when i play in editor i got a crash.

In debug it says:

Warning: UIpNetDriver::ProcesRemoteFunction: No owning connection for actor MyBP_C_1.

Anyone knows how to fix that?

Any network traffic must go through an owning connection which is usually attached to a player controller.
Actors that aren’t owned by any player just cannot send/receive network data.

So how can i be sure the actor is owned by something? (testing in editor with listen server)
Thanks

Take a read around, here:

and here:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/49577-how-to-know-on-client-side-if-an-actor-is-own-by-the-current-network-connection

Ive seen the second topic…

However, why would the client spawn without a controller? I assume that would be working when setting AGameMode:: DefaultPawnClass ?

EDIT:

I was able to fix the crash by changing to HasAuthority:



class FNetworkPredictionData_Client* USkateMovementComponent::GetPredictionData_Client() const
{
    check(PawnOwner != NULL);
    //check(PawnOwner->Role < ROLE_Authority);  << crash
    if (!PawnOwner->HasAuthority())
    {
        if (!ClientPredictionData)
        {
            USkateMovementComponent* MutableThis = const_cast<USkateMovementComponent*>(this);

            MutableThis->ClientPredictionData = new FNetworkPredictionData_Client_MyMovement(*this);
            MutableThis->ClientPredictionData->MaxSmoothNetUpdateDist = 92.f;
            MutableThis->ClientPredictionData->NoSmoothNetUpdateDist = 140.f;
        }
    }


    return ClientPredictionData;
}


It’s crashing because you’re using ‘check’ - and the function GetPredictionData_Client() is sometimes called on the Server (it’s used for smoothing IIRC).

I doubt that tutorial is up-to-date to be honest.