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"

PerInstanceRandom material input not working?


I'm trying to set up an opaque broken window material to apply on destroyed building windows.

I don't want every window to be broken in exactly the same way, so I'm trying to randomly rotate and pan my broken window texture by a fixed random number, before applying it on the rest of my material.

To achieve this I'm using the PerInstanceRandom node, the only random node usable in materials. Weird thing is, it doesn't seem to work.

It looks like this: alt text

If I use a constant instead, the texture pans and rotates as intended, but as soon as I plug in the random node, the texture resets to its default position.

Does anyone have a clue about what the problem is here? I tried to change the default speed of the rotator and panner nodes, to multiply my random number by diverse constants... Whatever I do, it doesn't seem to work.

Product Version: UE 4.9
randomglass.png (70.5 kB)
more ▼

asked Sep 13 '15 at 09:49 AM in Blueprint Scripting

avatar image

33 2 4 7

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

2 answers: sort voted first

I see this is an old post but I just came across it looking for more info on PerInstanceRandom.

Your problem might be that your not using instanced meshes. That node seems to only work if you apply it to an instanced mesh, otherwise it stays it's default value. But it worked for me by applying it to an InstancedStaticMesh component in a blueprint.

more ▼

answered Nov 16 '15 at 09:05 PM

avatar image

41 1 2

avatar image Seyroth Nov 16 '15 at 09:53 PM

Yeah I figured as much later. Worse than that, I wanted a random number for each repetition of the texture, not each mesh instance. I found there's no way to do that, which seems pretty logical now that I've had time to think about it.

To solve this problem then, unless I missed a functionality I don't know, you'd have to forget about having random rotation and to manually rotate the window UVs directly in your 3D modeling software, to make them appear random.

I was looking for a fast way to do it since it was for a jam submission and the mesh was quickly built from BSPs, so there was no solution for me.

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

Old post but I'll add this anyway. Another way you could probably do this that doesn't rely on instances is to use the world position to offset the UVs, used here just to make a bunch of objects not flash in sync.

![alt text][1] [1]: /storage/temp/250392-capture.jpg

capture.jpg (75.7 kB)
more ▼

answered Aug 13 '18 at 03:07 PM

avatar image

11 2 4

(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