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"

Is there a way to clear Dynamic Material Instances?

Each time I play the game in engine it creates a new MID for each object I have the component on. If I stop playing and start again it makes another one.

Does this have any performance impacts? I don't really know how much of this works as I'm new to game development.

The component is for a transparency system to hide objects between player and camera, it swaps to the material and scales its opacity down over time and replaces it with its old material when needed.

Product Version: UE 4.19
Tags:
midissue1.png (222.7 kB)
2.png (25.8 kB)
3.png (24.5 kB)
more ▼

asked Apr 26 '18 at 05:40 AM in Blueprint Scripting

avatar image

Mattxm
11 4 6

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

2 answers: sort voted first

You might try using the Tick function to check a Boolean variable (yes or no) of sorts in a Branch node, and if True, rather than creating a dynamic material instance, you could set the dynamic material instance, if false set to another. If you wanted to go a step further, you could create two variables, one for each dynamic material instance you want, that way you can change them on the go and access them easier.

more ▼

answered Apr 26 '18 at 06:27 AM

avatar image

BubbaBonkers
128 4 6 9

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

Does this have any performance impacts?

It has no impact. If you restart the editor, the extra indexes will be reset.

If you do not store your MID in a variable and it is no longer assigned to a mesh, it will be Garbage Collected. Structs are excluded as they're not UObjects.

more ▼

answered Apr 26 '18 at 12:37 PM

avatar image

Everynone
15.2k 77 25 62

(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