Download

Attach to Component Node creating Pending Kill Error

Hello,

So I’m working on a physical menu for VR interaction, basically the player casts a linetrace from the right hand and on hitting objects with a specific tag a small menu is spawned on the left hand. I’m having a strange issue where on the first linetrace call the Physical_Menu actor doesn’t spawn and I get the error:

PIE:Error: Error Blueprint Runtime Error: Attempted to access Physical_Menu2_C_0 via property CallFunc_FinishSpawningActor_ReturnValue3, but Physical_Menu2_C_0 is pending kill from function: ‘ExecuteUbergraph_MotionControllerPawn’ from node: AttachToComponent in graph: EventGraph in object: MotionControllerPawn with description: Attempted to access Physical_
Menu2_C_0 via property CallFunc_FinishSpawningActor_ReturnValue3, but Physical_Menu2_C_0 is pending kill

This error happens every other time the spawn is called, which is really confusing. I’m running UE 4.15 with an Oculus CV1 with Motion Controllers.

So each time I want to call this menu I have to cast the line trace twice and the menu works fine on the second cast. It’s a really annoying problem because it works half the time and works fine. I don’t think it’s an issue with garbage collection as the problem happens when the actor is initially spawned, and I can’t for the life of me figure out why Attach to Component would somehow cause a Pending Kill call?

Thanks!