x

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"

How do I swap materials on an actor using a key command?

I'm trying to create the ability to use a key command to switch materials on an actor.

For example, I have an actor that has 3 materials. When I hit the "[" key, I want the 2nd material to switch to one of the series of materials that I have created. I want the "[" key to cycle between the different materials, so that as I hit the key repeatedly, it changes the materials. Any ideas? Thanks for the help!

Product Version: Not Selected
Tags:
more ▼

asked Aug 07 '14 at 04:37 AM in Blueprint Scripting

avatar image

bzundel
51 6 11 12

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

3 answers: sort voted first

Thanks for the suggestions, everyone! I found a great way to do it. More of a "brute force" way, and I'm sure that there is a more concise way to do it. But it works really well for what I need: alt text

more ▼

answered Aug 07 '14 at 10:16 PM

avatar image

bzundel
51 6 11 12

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

Its possible. But first you must create an array of Materials inside your Actor to hold the materials that this Actor can cycle through. Later when the key is pressed, get the next/previous material from this array (using index and whch material is currently applied). After that get a reference to the static mesh of this Actor and call the node 'Set Material' and pass the next material from the array and the static mesh as inputs.

Make the array of materials editable, and later when you place the Actor in the level, you can add items into this array (materials from content browser)

more ▼

answered Aug 07 '14 at 05:04 AM

avatar image

mindfane
3.4k 154 52 271

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

Do you mean something like this? or that it can switch between materials that are already applied to the mesh?

alt text

Second link to the picture: https://imageshack.com/i/kpxH3XOop

more ▼

answered Aug 07 '14 at 01:54 PM

avatar image

Skullwing
256 20 15 23

(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