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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Cannot use Static Mesh Component with Set Vector Parameter Value

I'm extremely frustrated with this. I have a very basic problem I'm trying to work through; assign a new random color to a block every 30 game ticks. I've looked and there already seems to be a decent number of solutions to my problem, all of which use the Set Vector Parameter Value block. But frustratingly, in every single answer the block's input values are fundamentally different from mine. All the solutions I've looked at show a Static Mesh Component being directly linked to a Target parameter on the block. However, on the block in my blueprint there is no Target parameter, only a Collection parameter, and trying to connect my Static Mesh Component to it gives me an error. Instead, it tells me it takes a Material Parameter Collection, which is seemingly incompatible with my Static Mesh Component. I have no idea what that is or how to use it, and not a single tutorial I come across mentions it at all.

Here is an image of my current blueprint; alt text

What is this change, and why was it made? How am I meant to use the Set Vector Parameter Value block?

Edit: Here is a link to my project file; https://mega.nz/#!RYs2DS4Q!_I2HjO1mtBrPDFdik8Z4qCkMi3da5S470iw17vFd31w

Product Version: UE 4.10
Tags:
more ▼

asked Mar 17 '16 at 05:07 AM in Blueprint Scripting

avatar image

Maurdekye
1 1 4 3

avatar image Black Phoenyx Mar 17 '16 at 05:17 AM

Is this the node you are trying to get?

alt text

avatar image Maurdekye Mar 17 '16 at 05:21 AM

What? Why is yours different from mine?

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

2 answers: sort voted first

Wasn't sure if that was the node you were after or not.

Turn Context Sensitive off: alt text

more ▼

answered Mar 17 '16 at 05:25 AM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image Maurdekye Mar 17 '16 at 05:26 AM

Wait what? There are two nodes with the same name, and almost the same functionality? Who thought that was a good idea? Especially since the editor doesn't recommend the other one.

avatar image Maurdekye Mar 17 '16 at 05:27 AM

Thanks, regardless.

avatar image Maurdekye Mar 17 '16 at 05:30 AM

No, nevermind, I still can't use it. I can't find a Set Vector Parameter Value node with the same inputs as yours; neither of the two that show up for me after disabling Context Sensitive have four arguments, and neither of them take my static mesh as an argument.

Here is an image of the two different Set Vector Parameter Value nodes I could find; alt text

I suppose this is one reason people use Unity.

avatar image Black Phoenyx Mar 17 '16 at 05:37 AM

I think there is more than 2 of them...I have at least 3 just in the screenshot and I've seen more as well....the one with the green arrow is the one I used to connect the static mesh to: alt text

avatar image Maurdekye Mar 17 '16 at 05:40 AM

Here is an image of every single highlighted node I could find when searching for the keyword "vector parameter"; alt text

None of them look like yours. Are you sure you're using the same version of UE that I am?

avatar image Black Phoenyx Mar 17 '16 at 05:47 AM

Yeah, 4.10:

alt text

ueversion.png (108.9 kB)
avatar image Black Phoenyx Mar 17 '16 at 05:51 AM

Are you dragging off of a static mesh when you do the search?

avatar image Maurdekye Mar 17 '16 at 05:54 AM

No, i'm just right clicking in empty space. This is what my search looks like; alt text

Pretty much identical to yours.

At this point i'm entirely convinced that you must somehow have a slightly different version of the editor, where the appropriate Set Vector Parameter Value node has that one extra input on it. And somehow, I don't.

avatar image Black Phoenyx Mar 17 '16 at 05:59 AM

I am dragging off of a static mesh component in the blueprint to get that node...hover over the 2 listed under material and look for the one that doesn't have MID in the description....MID is Material Instance Dynamic which is one of the nodes you posted already

avatar image Maurdekye Mar 17 '16 at 06:04 AM

Ah, fantastic! That finally worked. Why does it add that extra parameter only when you drag it off of the static mesh component? And why doesn't it have that parameter by default?

avatar image Maurdekye Mar 17 '16 at 06:06 AM

Well, I ran the script, and it doesn't work. The logic up until the set vector parameter node seems to be working perfectly fine, but the block's color doesn't actually change.

Here is my current blueprint; alt text

avatar image Black Phoenyx Mar 17 '16 at 06:13 AM

Its not there by default because.....reasons... I guess lol.... I don't really have a good answer for that...maybe I should ask this...just so I know exactly what you are trying to accomplish....what are you trying to get to happen to the static mesh on tick?

avatar image Maurdekye Mar 17 '16 at 06:33 AM

I explain it in the top post; I'm trying to assign a new random color to a block every 30 game ticks.

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

Ok sorry I was focusing on the Node problem...to do that: First create your material and setup the Color parameter: alt text

The you need to create a Material Instance of that material so you have access to the parameter Color like this: alt text Then your BP needs to be setup like this:

alt text For the Source Material of the Create Dynamic Material Instance node make sure that is set to the Material Inst you just made.

colorsetup.png (49.8 kB)
matinst.png (140.5 kB)
bpsetup.png (158.2 kB)
more ▼

answered Mar 17 '16 at 07:14 AM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image Maurdekye Mar 17 '16 at 07:26 AM

Thank you, this makes more sense. Can I ask what the Create Dynamic Material Instance and SET nodes are for? They don't seem to affect any output at all. Couldn't you just link the Set Material node directly to the Event BeginPlay node, and that would work?

avatar image Maurdekye Mar 17 '16 at 07:31 AM

Also, how do I set up the color parameter? If I try dragging my mouse out of the Base Color attribute of my Material, I can't find a color node in the search list like the one you show. This is all I see; alt text

avatar image Black Phoenyx Mar 17 '16 at 07:34 AM

Oh sorry hold down the number 3 and then click anywhere in the graph a vector 3 should pop in right click that node and select convert to parameter, in the details panel change its name from None to Color

avatar image Maurdekye Mar 17 '16 at 07:40 AM

I, uh.. holding down 3 and clicking on the grid doesn't do anything different, it just brings up a node browser and fills the search bar with 3's.

avatar image Black Phoenyx Mar 17 '16 at 07:47 AM

Hold down 3 and Left click

avatar image Black Phoenyx Mar 17 '16 at 07:49 AM

or type constant3vector in the search....holding down 3 and left clicking is just a shortcut

avatar image Maurdekye Mar 17 '16 at 07:52 AM

Ah, there we go. Thanks.

avatar image Black Phoenyx Mar 17 '16 at 07:33 AM

You need a variable reference to the mat inst in dynamic form otherwise you can't change the parameter values on the fly during game play so we must first make a dynamic version and to keep us from having to do that on tick we set it on begin play so it only fires once. The set material node makes sure that the new dynamic version of the material is applied to the static mesh on begin play then using the set vector values we are now setting the Color parameter values of the dynamic material in real time during game play....make sense?

avatar image Maurdekye Mar 17 '16 at 07:41 AM

So, let me get this straight; the material is static by default, but we need to make it dynamic in order for it to change during runtime? So that's what the extra nodes are doing, they're making the material dynamic?

avatar image Black Phoenyx Mar 17 '16 at 07:46 AM

Not static by default they are just not dynamic they get "ironed" into the scene so to speak during the base pass draw by the cpu and then that information is passed on to the gpu to render out the scene to your screen in a nut shell...roughly speaking. The extra nodes are creating a dynamic version that is part a different pass on the draw cycle, and yes they are making the material dynamic.

avatar image Maurdekye Mar 17 '16 at 07:53 AM

So, what you're saying is, they are?

avatar image Black Phoenyx Mar 17 '16 at 07:54 AM

Yes the extra nodes are making the material dynamic

avatar image Maurdekye Mar 17 '16 at 07:59 AM

Okay thanks, just needed clarification.

avatar image Maurdekye Mar 17 '16 at 07:54 AM

How do you get a reference to the dynamic material within the blueprint of the static mesh?

avatar image Black Phoenyx Mar 17 '16 at 08:00 AM

alt text

bpsetup2.png (184.9 kB)
avatar image Maurdekye Mar 17 '16 at 08:06 AM

No, sorry, my question wasn't quite that complicated. I was just wondering how you introduced a reference node to the dynamic material into the blueprint. ie., how did you create these blue nodes;

alt text

avatar image Black Phoenyx Mar 17 '16 at 08:14 AM

alt text

bpsetup3.png (201.9 kB)
avatar image Maurdekye Mar 17 '16 at 08:17 AM

Ah, okay. Sorry, I misunderstood your previous explanation. I'm very new to UE and blueprint, if you couldn't tell.

avatar image Black Phoenyx Mar 17 '16 at 08:23 AM

Its ok, everyone starts somewhere and if you don't ask questions you won't get answers.

avatar image Maurdekye Mar 17 '16 at 08:26 AM

Thank you very much for your explanation and consistent replies to help me with my problem. I've adjusted my blueprint to look like this;

alt text

As far as I know, it should have the same functionality as the one you show above. However, the cube's color still does not change. If there's anything wrong with the way I've laid it out, please let me know.

avatar image Black Phoenyx Mar 17 '16 at 08:39 AM

Yes there is some things wrong the create dynamic material instance node is the wrong one! AH! Drag from the static mesh and then type create dynamic material instance use "gets" in the places I did drag the variable from the panel while holding Ctrl to get a "get" version of the variable, your BP should basically look like mine with only name differences of the materials or variables

avatar image Maurdekye Mar 17 '16 at 08:44 AM

Okay, I've modified my blueprint to use the version of the Create Dynamic Material Instance node where it takes input from the static mesh;

alt text

But why should I be using separate get versions of the variable, rather than referencing them from the set node? It tells me that I can use them in place of get nodes if I want, and in my opinion it looks better and is easier to understand. Is there a logical difference between the two that I'm not aware of?

Also, I've run this and it still doesn't work.

avatar image Black Phoenyx Mar 17 '16 at 08:48 AM

Try using the gets OR take a look at the one I sent you

avatar image Black Phoenyx Mar 17 '16 at 08:45 AM

BP Files Download - Click HERE

Ok try this....download this zip folder unzip it and copy the folders in it to your project's content folder the folders you should copy are the Blueprints, Geometry and Materials.....to get to your content folder from your content browser right click on the top folder labeled "Content" and click Show in Explorer that's where these need to be pasted...in the folders I have included a working version of the BP for you to have a look at.

maurdekye.zip (461.3 kB)
avatar image Black Phoenyx Mar 17 '16 at 08:50 AM

once you paste them you may have to restart the project

avatar image Maurdekye Mar 17 '16 at 09:27 AM

Ah, thank you very much. After creating a new project and integrating the items you gave me, I successfully got it to work. I then slowly modified your blueprint one node at a time until it looked like mine, to make sure that it wasn't my blueprint design that was causing the issue, and it still worked. I also modified the Create Dynamic Material Instance node to be of the type that doesn't require a static mesh parameter, and it still worked after that. I then looked around the files you gave to see what any other differences there might be, but I cannot find anything else different. At this point I modified your project to be functionally identical to mine, except yours works and mine does not.

avatar image Black Phoenyx Mar 17 '16 at 09:33 AM

Hmmm not sure what was going on in your then without actually seeing it....glad you got it figured out though...now you should try to create a new version on your own so you can make sure you really understand how to do it

avatar image Black Phoenyx Mar 17 '16 at 09:33 AM

Don't forget to mark this as resolved/answered

avatar image Maurdekye Mar 17 '16 at 09:39 AM

Although I technically have a working project, I don't actually know how to fix my problem. So I don't really feel like marking it as resolved yet. I'll eventually post my project file here in it's entirety so that if you feel like you have the time, you can download it for yourself and see what I did wrong. But until then, I need to go to bed.

avatar image Black Phoenyx Mar 17 '16 at 09:50 AM

Ok, I'll keep an eye out for it

(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