Description

If FActorSpawnParameters::bRemoteOwned is set to true, calling SpawnActor with this spawn param on begin play has different behavior than calling the SpawnActor elsewhere during runtime.

If using network play (multiple players set / dedicated server set), a crash occurs.

Steps to Reproduce
  1. Create UE4 C++ First Person template Project
  2. Open .sln in Visual Studio
  3. In the Character.cpp file add the following
    • in Character::OnFire()
      	FActorSpawnParameters NewParams = FActorSpawnParameters();
      	NewParams.bRemoteOwned = true;
      
    • Add "NewParams" after SpawnRotation in the SpawnActor calls
    • Add call to OnFire in Character::BeginPlay().
  4. Compile
  5. In the editor Pres the Play button followed by left mouse button (2-3 times)

Result:
Projectile is spawned on Begin Play and travels expected projectile movement path. Projectiles spawned on left click hang in the air and don't follow projectile movement

Expected:
Spawned actors behavior is consistent regardless of when the spawn call is occurring.

Callstack

**Crash when set to dedicated server**

MachineId:7156C35640F86204E61B8383F45DEE17
EpicAccountId:e8c7fa630b6440f69a25a2c64d6c482c

Assertion failed: RemoteRole == ROLE_Authority [File:D:\Build\++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp] [Line: 2948] 



UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:421]
UE4Editor_Engine!AActor::PostNetInit() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\actor.cpp:2950]
UE4Editor_Engine!UActorChannel::ProcessBunch() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:2131]
UE4Editor_Engine!UActorChannel::ReceivedBunch() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:1967]
UE4Editor_Engine!UChannel::ReceivedSequencedBunch() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:273]
UE4Editor_Engine!UChannel::ReceivedNextBunch() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:627]
UE4Editor_Engine!UChannel::ReceivedRawBunch() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:357]
UE4Editor_Engine!UNetConnection::ReceivedPacket() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1181]
UE4Editor_Engine!UNetConnection::ReceivedRawPacket() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:617]
UE4Editor_OnlineSubsystemUtils!UIpNetDriver::TickDispatch()
UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:848]
UE4Editor_Engine!TBaseMulticastDelegate<void,float>::Broadcast() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:921]
UE4Editor_Engine!UWorld::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1185]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1408]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:371]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2834]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launch.cpp:156]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.13
Target Fix4.14
Fix Commit3152568
Main Commit3153517
CreatedSep 13, 2016
ResolvedOct 5, 2016
UpdatedApr 27, 2018
View Jira Issue