[4.8.1, Mac] UGameplayStatics::SpawnEmitterAttached crashes engine

Hi all,

I’ve come across a bug on a mac in which the editor crashes on compile, rendering the project unopenable afterwards. I’ve narrowed it down to a call of UGameplayStatics::SpawnEmitterAttached in one of my C++ classes. No matter how I call it, it seems to trigger the crash, and I’ve been able to reproduce it in two separate projects.

I’ve attached a logfile of the error here.

Hi ,

I’m having trouble attempting to reproduce this using that function alone. Can you provide me with the code file that you’re calling this function in? I’ll need some more context to continue attempting to reproduce this.

Hi ,

I created a standard project from the Side Scroller template and added the code to recreate it. I’ve attached the two offending files here with the added code.

I’m on a Macbook Pro Early 2011 if that helps.

Hi ,

I wanted to give you an update and let you know that I’m still looking into this issue. Unfortunately I haven’t made any considerable progress thus far but I will attempt to get back to you as soon as possible.

Hi ,

It appears that the function that you’re calling involves calling ‘NewObject’ (Which cannot be called in the constructor) and is meant to be called at runtime instead of in the constructor which is by design. I would suggest to either allocate the particle system and set up what it should be attached to in the constructor, or move this function call to OnBeginPlay instead.

Hope this helps!

Ah, that makes perfect sense.

Thanks so much for your help on this!