How to add more than four instanced static meshes to a blueprint?

Another Edit:

I got it working by adding the component under the static mesh set as the root of the blueprint whereas before the blueprint node in the component treeview may have been selected when trying to add the instanced static mesh - not sure if you just aren’t supposed to add instanced static meshes as root nodes but leaving this post here unless the admins delete it because it seems like there should be a default to a child of the root node or at least a box saying you can’t add it there instead of corrupting the blueprint and crashing the editor.

Edit:

I deleted the blueprint causing the issue and replaced it with an older version, that got the editor to load so I’m changing this post title to more accurately reflect the issue.

When going in to edit the blueprint that caused the issue to add another instanced static mesh (there are currently four of them, all set to static/not-moveable referencing different meshes, each of the four create about 80 instances of their mesh within the blueprint’s constructor) the editor freezes as it did originally then crashes without displaying an error. Upon restarting the issue the error occurs again.

Original post:

I tried to add an instanced mesh to a blueprint and while the dropdown was still visible (the click even on the instanced mesh component may or may not have gone through, not sure) the editor froze for several minutes then crashed. I had just imported a new static mesh into the editor prior and changed its material, that seemed to go through OK.

Upon the next start it gave me the option to recover two files so I hit recover and it immediately crashed.

Now whenever I start the editor to open the project it gives the following error (minus machine and account id):

Access violation - code c0000005 (first/second chance not available)

msvcr120 + 247382 bytes
UE4Editor_Engine!TArray<FBodyInstance * __ptr64,FDefaultAllocator>::Insert() + 130 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\containers\array.h:1412]
UE4Editor_Engine!UInstancedStaticMeshComponent::SetupNewInstanceData() + 935 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\instancedstaticmesh.cpp:1321]
UE4Editor_Engine!UInstancedStaticMeshComponent::AddInstance() + 118 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\instancedstaticmesh.cpp:1150]
UE4Editor_Engine!UInstancedStaticMeshComponent::execAddInstance() + 175 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\classes\components\instancedstaticmeshcomponent.h:63]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3684]
UE4Editor_CoreUObject!UObject::CallFunction() + 1112 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:395]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() + 141 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1451]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3684]
UE4Editor_CoreUObject!UObject::ProcessEvent() + 3036 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:924]
UE4Editor_Engine!AActor::ProcessEvent() + 259 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:529]
UE4Editor_Engine!AActor::ExecuteConstruction() + 655 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorconstruction.cpp:552]
UE4Editor_Engine!AActor::RerunConstructionScripts() + 3610 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorconstruction.cpp:436]
UE4Editor_Engine!ULevel::IncrementalUpdateComponents() + 521 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\level.cpp:745]
UE4Editor_Engine!UWorld::UpdateWorldComponents() + 820 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:1215]
UE4Editor_UnrealEd!FUnrealEdMisc::CB_MapChange() + 173 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedmisc.cpp:930]
UE4Editor_UnrealEd!TBaseRawMethodDelegateInstance<0,FUnrealEdMisc,void __cdecl(unsigned int)>::ExecuteIfSafe() + 14 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:582]
UE4Editor_UnrealEd!TBaseMulticastDelegate<void,unsigned int>::Broadcast() + 165 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:1030]
UE4Editor_UnrealEd!UEditorEngine::Map_Load() + 7326 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editorserver.cpp:2340]
UE4Editor_UnrealEd!UEditorEngine::HandleMapCommand() + 349 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editorserver.cpp:5680]
UE4Editor_UnrealEd!UEditorEngine::Exec() + 797 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editorserver.cpp:5180]
UE4Editor_UnrealEd!UUnrealEdEngine::Exec() + 273 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedsrv.cpp:742]
UE4Editor_UnrealEd!FEditorFileUtils::LoadMap() + 789 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\filehelpers.cpp:1910]
UE4Editor_UnrealEd!FEditorFileUtils::LoadDefaultMapAtStartup() + 216 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\filehelpers.cpp:3070]
UE4Editor_UnrealEd!FUnrealEdMisc::OnInit() + 2263 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedmisc.cpp:299]
UE4Editor_UnrealEd!EditorInit() + 3254 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealed.cpp:86]
UE4Editor!GuardedMain() + 926 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

How do I fix this?

Hello ,

I was unable to reproduce this issue from the information given in your post. I have a few questions that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. What version of the engine are you using?
  2. Can you reproduce this in a clean project?
  3. If so, could you provided a detailed list of steps to reproduce this issue on our end?
  1. The version is 4.7.2
    2 and 3. I’m not able to reproduce it in a clean environment however the issue is surfacing in a different way now. I made a new level with nothing but the blueprint, the player and some lights and any time I attempt to load the level it crashes. If you’d like I could make you a temporary readonly login for my subversion repo and email you the details of it - not sure how else to reproduce this issue (it seems to come back up sometimes when interacting with the blueprint on the level that works or rebuilding the lighting, but that’s as far as I’ve been able to determine myself).

Hello ,

Would it be possible for you to provide your project to me via dropbox or googledrive so that I may take a closer look?

I uploaded it to Google Drive for you at https://drive.google.com/file/d/0Byu6_LED4AkaUk9peHViSm5fZWs/view?usp=sharing

To reproduce the issue open the project then open the level Maps/HZ_Floor1 - if it doesn’t crash from that try building the project then changing levels and that should get it to do so.

Hello ,

After looking over your project I have found that it is crashing when you load up the level HZ_Floor1 because you are spawning an infinite number of CageBs into your level during the construction process.

Explanation:

CageB says to spawn CageB X number of times. This logic would be fine, however the logic is located in the construction script of the blueprint itself. This means that every time an instance of CageB is spawned into the level each of those CageBs then spawn more CageBs. I hope that this information helps.

Make it a great day

I’m not quite following on this - the only instances being created are of two different instances starting CageBGlass - they are static meshes not blueprints. Am I initializing these incorrectly to make it create new instances of the blueprint? The nomenclature I went with might be a bit confusing since everything starts with CageB

Here’s an image of all the add instances that are active:

I remade all the add instance calls after renaming the instanced static meshes and deleting all but two of them then removed all the disconnected nodes and it appears to work on both maps and when building - still unsure what actually caused the issue because I didn’t see any calls to create CageB but thank you very much for your insight on this matter - it definitely helped.

Spoke a bit too soon it seems. I’ve made a new question that seems to fit the specifics of the issue more closely.

Hello ,

I have posted a suggestion on your other question. I am going to mark this thread as resolved. I because I am no unable to reproduce the crash with the project that was provided. However, if the suggestion that was given does not elevate the problem that you are having please feel free to reopen this thread.

Make it a great day.