4.8 Major issues in attaching child component and Overlap trigger (With repro)
Summary of issues:
Issue 1) Attaching a child component (eg: SphereComponent) from C++ code to an Actor's root in 4.8 results in an error on PIE with the message
Issue 2) Even if the first issue is bypassed through a workaround, Overlap events are not triggered for attached collision components. Attaching a similar sphere component through the Blueprint components screen works perfectly so this issue appears limited to C++. IIRC, various issues with overlap events in 4.8 have been reported by others as well.
Note: The workaround needed to fix issue 1 involves moving attachment of the child component from the constructor to PostInitializeComponents (as attaching from the constructor causes the template mismatch error).
Issue 3) Issue #2 can be fixed by recompiling the blueprint in question and launching PIE again. This time, all overlap events work, however once the PIE session is closed the editor crashes with the following message:
Repro project links:
All three issues are reproducible with blank template projects and some simple code for attaching a sphere component.
In both projects take a look at the AMyActor C++ classes and MyActor Blueprint (which has been dropped into the level). Launching PIE should crash the first project (issue #1). The second project will launch PIE but overlap events won't be triggered for MyActor (issue #2). Recompile the MyActor blueprint and run PIE again, this time the editor will crash after PIE exits (issue #3)
I've posted a single bug report for these issues as I get the feeling they're coupled with each other, am happy to raise separate reports for each of these if that's preferred though.
A quick look at code for each issue follows:
Issue #2, #3:
Thanks for looking, this is preventing me from moving on to 4.8 so can't wait to get past the issues!
I opened your project (the first one) and did not receive any error message when I PIE however I did notice that the actor blueprint was at the world origin rather than where it was placed in the level. Looking at the projects you supplied, I changed the UPROPERTY() of the scene component and sphere component from "VisibleDefaultsOnly" to "EditAnywhere" which solved the issue of the actor moving to the world origin as well as allowed the OnComponentBeginOverlap event to play appropriately. Let me know if making this change helps on your end or if you're still having any issues.
answered Jun 17 '15 at 09:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here