Triggering Simple Commands Within Actor BP
I have an actor BP made up of 5 or so instanced static meshes and instanced throughout my scene. I now want to switch the materials with a keyboard key "X" in this condition but nothing is working. I have this in the actors event graph: X key triggering set material to one of the instanced static meshes, very simple BP but its not working no matter what i do. Any ideas?
asked Sep 14 '17 at 10:46 PM in Blueprint Scripting
So the main thing is your standard actor won't take input events directly, You're better off passing it from whatever is reading your input (character, controller) with a function or event call.
The other thing is, you pay a tradeoff with instanced static meshes. Their performance boost comes with the drawback that they are not really meant to be edited at runtime and I find that if I need to do anything with a mesh during runtime I just have to use a proper static mesh.
Hopefully that answers your question.
answered Sep 14 '17 at 11:07 PM
Maybe I'm asking the obvious but have you put this in your level blueprint?
Otherwise the event simply won't fire.
Have you tested if the input goes through with a Print String?
Also your logic sets 4 different materials to the same object (the fourth is double).
You should also check if your Headrest object isValid.
Follow this question
Once you sign in you will be able to subscribe for any updates here