The user should be calling SetStaticMesh() instead of setting the property directly.
Spawning a StaticMeshActor at runtime results in the StaticMeshActor not being visible until a property has been changed, such as the material for the Static Mesh. The spawned actor will also have no collision unless it is set from Static to Moveable.
1. Download the attached project
2. Right-click the .uproject file, generate Visual Studio project files, compile the project, open the .uproject file.
3. Open the untitled map and press play
Result: Nothing appears but a StaticMeshActor is spawned, which can be found in the World Outliner.
Expected: A StaticMeshActor using the 400x400 floor static mesh should appear
To see problems with collision
1. Uncomment line #23 in MyActor.cpp and recompile (This will make the StaticMeshActor appear when it spawns)
2. Press play in the editor and attempt to collide with the newly spawned actor
Result: Collision does not occur
Expected: You should collide with the actor
To make the collision work, uncomment line #26 in MyActor.cpp and recompile.
How does TextureRenderTarget2D get TArray<uint8> type data?
Why does the REMOVE method of map container remove elements have memory leaks?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
How to delete some elements correctly when deleting an array loop?
How do I set a material as a post-processing material?
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.10, 4.11, 4.12 |
Target Fix | 4.11 |
Created | Dec 22, 2015 |
---|---|
Resolved | Jan 4, 2016 |
Updated | Apr 27, 2018 |