Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

alt text

Product Version: UE 4.17
untitled-1jhb.jpg (329.5 kB)
more ▼

asked Sep 14 '17 at 10:46 PM in Blueprint Scripting

avatar image

177 33 46 53

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Sep 14 '17 at 11:07 PM

avatar image

Ruffhaus Games
663 13 9 23

avatar image Dark_Jubei Sep 15 '17 at 08:55 AM

Hey Bizmark, to clarify, you're saying I should use a function to do this? that should work? This is a VR project, so the performance gained is VERY helpful, I understand what you're saying about instances but I only really need to switch out the materials on these instances, and they all need to be the same when they switch too, so hopefully that should be ok.

avatar image Ruffhaus Games Sep 18 '17 at 11:22 PM

No as Schnittbrot mentioned it won't fire in an actor because they do not take input events (unless you set them up to, there is documentation available if you really want to). It's better to trigger this another way and a function is a simple way to do that, referenced from somewhere that will take the input event if that's how you want to trigger it. This is by no means the only way to do it just one suggestion.

If you really want to use instanced static meshes you can select the materials that are being applied to them and make sure that "Use with instanced static meshes" is true. I can't speak to whether this will result in the gains from the instanced static meshes becoming void or not.

Also just to reiterate Schnittbrot's point when referencing something, it's always good practice to run it through an IsValid just for safety.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Sep 15 '17 at 11:14 AM

avatar image

219 2 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question