add actor component at runtime?

so here im trying to get the index of a map and adding to the player the component present in the map at that index, everything works fine except it doesnt add the component…is it possible? if yes how can i do this? thank you :slightly_smiling_face:

Hey @avuio!

You may want to make sure that it isn’t being added!

Firstly, you want to test with printstrings. Put one before and one after your “Add Component”. The one after should pass in the return value from the “Add actor Component”.

If it gives a Static Mesh, make sure you’re attaching that static mesh with “Attach Component to Component/Actor.”

During gameplay, if you do this, press CTRL+F1 to get mouse control, then Eject. Find the player in the world outliner, and look at the details. If it is added it will show here.

The reason for all of this is that there is a very different fix for not creating something vs something getting created but not noticed, which is almost always the more common thing that has happened.

Hope that helps, get back with us with what you found out! :slight_smile:

1 Like

nevermind in the end i went with another approach and for now it seems to work :grimacing: :joy:
thank you anyway for your advice :slightly_smiling_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.