Child actor is destroyed while demo playing

  1. create a spectator pawn with a child actor component
  2. start a replay (such as “demoplay demo1”)
  3. change the DemoCurrentTime by call GotoTimeInSeconds
  4. any reference to the child actor will cause a crash after a moment, the pointer to the actor is set to nullptr by GC

any actor spawned in spectator’s beginplay will be destroyed after call GotoTimeInSeconds

Hey windywang,

Can you tell me where you are getting “demo1”? Are you using an existing project? Or, are you speaking for a project you’ve created?

Thanks.

I found a way to solve the problem:

  1. set the owner to spectator controller
  2. set bNetStartup of actor to true

you can use ShooterGame for test