Download

Rotation replication

Hello,
i have created a simple top down rotation blueprint, when i use my authority client rotation is great, but my remote client will always face the center of the map. If you can please help me.
Thanks

Does this run on clients? Can you show me how you call that event/function?

I do a switch has authority, if authority i wire ir up to set actor rotation and if remote i call a custom event whitch is reliable and runs on server (custom event goes into set rotation too).

I primarily work out of C++, but Ive noticed that if you set the CharacterMovementComponent such that rotation does NOT follow velocity, then the Pawn’s rotation is not replicated. So I set up a separate replicated FRotator variable and in the Authority Pawn’s Tick() I set the replicated FRotator variable to the desired rotation, and then on CLIENTs I set the Pawn’s rotation directly to whatever the replicated FRotator variable is.

So in C++:



	if (Role == ROLE_Authority)
	{
		SetActorRotation(GetCustomRotationFunction());	//However you wish to set the pawn's rotation for your game mechanics
		ReppedRotation = GetActorRotation();		//Pass the resulting rotation to the Replicated FRotator
	} else
	{
		SetActorRotation(ReppedRotation);		//Apply the replicated rotation to the CLIENT
	}


There is a solution?