4.21 - 4.22 Motion Controllers stopped responding

Hi everyone,

It’s coming from their all new HasLocalNetOwner() which should normally crashed when the owner is the level. And instead always returns false;

bool AActor::HasLocalNetOwner() const
{
	// I might be the top owner if I am a Pawn or a Controller (owner will be null)(Epic's comment)
	const AActor* TopOwner = this;

	// Epic tries to retreive the last owner
	if (Owner != nullptr)
	{
		// I have an owner so search that for the top owner (Epic's comment)
		for (TopOwner = Owner; TopOwner->Owner; TopOwner = TopOwner->Owner)
		{
		}
	}

	// Top owner will normally be a Pawn or a Controller (Epic's comment)
	// WRONG !! It can be the level itself in case of spawning an actor from it !
	if (const APawn* Pawn = Cast<APawn>(TopOwner))
	{
		return Pawn->IsLocallyControlled();
	}

	// The level hasn't got controller so normally "Controller->IsLocalController()" should crash the engine
	const AController* Controller = Cast<AController>(TopOwner);
	return Controller && Controller->IsLocalController();
}

That’s really strange that code has successfully passed the Q&A tests.

Anyway, in your FActorSpawnParameters.Owner, make it to nullptr and maybe should do the trick.

UPDATE : That worked for me I got back my controllers. Now the Custom Depth haha :stuck_out_tongue:

Best regards,

Alexandre