HateDread
(HateDread)
September 20, 2014, 6:29am
18
Couple of shot gun answers to various things in the thread:
As was mentioned AttachParent should be used when setting up your components in the constructor because it will do the AttachTo and all the associated actions when the components get registered. Doing AttachTo in the constructor will generally not get you what you want.
Template component simply means that it is a component that belongs to the Class Default Object, which is the prototype/template object from which other instanced objects get their properties initialized from.
The ensure message means that when the attachment is being executed your SpawnBox component is trying to attach itself to the component in the CDO, not its own instanced version.
I tried to reproduce this ensure by creating a new subclass of ANavigationObjectBase and just putting in the subobject pointer as in 's post, but I couldn’t reproduce it. It probably shouldn’t cause an issue, but try taking the space out of the name of the component?
If you’re able to isolate the problem down to a simple repro in a new project, please do post on answerhub and attach the project.
Hi Marc,
I’ve managed to reproduce this issue with Preview Build 2289630: Adding UBoxComponent to a custom PlayerStart class crashes gameplay - Programming & Scripting - Epic Developer Community Forums
Turns out it only happens when you place the custom PlayerStart in the world, then copy-paste it to make several instances. This process is fine with normal PlayerStart objects, but when you try to add your own components like I have above, and then copy-paste that custom PlayerStart, it crashes when PIE (haven’t tested standalone).