No announcement yet.

Adding components at runtime using Blueprints

  • Filter
  • Time
  • Show
Clear All
new posts

    Adding components at runtime using Blueprints

    So I am trying to at runtime add a handful of Instanced Mesh Components to an Actor.
    This code runs without errors, but doesn't add the components and I can't figure out why.

    Click image for larger version

Name:	f57625a5e0.jpg
Views:	1
Size:	76.8 KB
ID:	1185064

    Any help appreciated.

    Yes I've found this to be an issue as well. I believe its because instance static meshes require a existing static mesh. So if the static mesh isn't in the level already it doesn't exist. It may be better to have an actor that is out of visual range which just has variables stored with each static mesh and using them at run-time to set the static meshes.

    Not ideal but static meshes are a bit of a pain when it comes to adding them at run-time. Additionally you may want to add a make transform node attached to the instance static mesh component as in your image it would currently not appear and give you a compile warning (not an error), if you have a blank transform node (with scale set to 1,1,1) it may work. It currently says spawn me at V:0,0,0-R:0,0,0-S:0,0,0 i.e S:0,0,0 is 0 pixels or 0 size so it doesn't appear.

    Hope that helps