Crash When Adding Static Mesh to Actor [C++]
UPDATE: For those who do a search and get this.
I've deduced the crash was actually from the
Adding static meshes to actors is as follows:
I have a for loop wherein a "room" class is created a certain number of times. As of yet, this class has only contained some basic information, like what type of room it is, it's length and width, where it should be placed, etc. I'm trying to visualize this in the editor by adding a StaticMeshComponent to the actor. Doing so causes the editor to crash in a heaping pile of fire and quietly muttered expletives.
The For Loop:
Only when those two lines are added, when a StaticMeshComponent is added to this item, does the game crash.
To answer the second question first, declaring the static mesh component in your header and setting the static mesh in your constructor are two different things. To fix this you would want to take out the lines below "PrimaryActorTick" and replace them with
As for the crashes, the second crash is from trying to assign a static mesh to a static mesh property incorrectly. Without the log files (inside the project's Saved/Logs folder) it would be difficult to say what the cause of the first crash is.
answered Aug 11 '15 at 03:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here