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"

"get all actors with tag" means random ?

Do you have any idea what is wrong with my BP (i add a screenshot below)? As you can see I create a function to change the material of tagged -static mesh actors-. It's actually working, but he result is not expeted. Every StaticmeshActor get one of the 3 materials, but set randomly (an actor B get a material 1; an actor A get material 2 etc... and when i hit B get 3 and A get 1 etc...) .Instead of getting the material 1 for actors A and B, then only material 2 for A and B etc..
And do you know if there is a way to connect my "for each loop" directly to the target of the "set material" instead of use a "cast to staticmeshactor"? (I'm wondering if this "cast" give this bad result)

Thanks

[1]: /storage/temp/215661-capt.png

Product Version: UE 4.17
Tags:
capt.png (537.3 kB)
more ▼

asked Oct 04 '17 at 07:53 AM in Blueprint Scripting

avatar image

guiguimbop
1 2 4

avatar image IGorilla Oct 04 '17 at 12:26 PM

Get all actors with tag does not get them in a certain order like you expect. One time actor A will be first, the other time actor B. It does not know they should be in a specific order. Im not sure what your expected result is... if you want all actors to have the same materials you need a forloop, not do n loop. And the indexes you are setting would probably be 0,1,2 and not 0,0,3.

avatar image guiguimbop Oct 04 '17 at 01:57 PM

Hi IGorilla, thanks a lot for the reply. The 0,0,3 is a mistake of me, searching if there was consequence changing thoses values. The only way to get an action is to set all on 0 (0,0,0)*. I send an other screenshot to corrige it.alt text

I don't want to consider order with my actors. I just want them to change material all together in the same time. Something really basic. The only order i want is material 1 when i hit (of all actors); than material 2 etc...

You said to use forloop instead of n loop. But it's seems that i call all the 3 materials in once (so nothing happend). To simplify i replace those integer system by a simple multigate (as you can see on the screeshot). Do you think the problem could come from the "cast" part ? And do you know an other method to connect an actor to a target which accept only the "primitive component" ?

Thanks

capture2.png (872.6 kB)
avatar image guiguimbop Oct 04 '17 at 02:20 PM

Not a problem of casting. With an other method found on internet, same weird redult. Do you thing i have to add something on the array index's node of "for each loop" ?

alt text

capture3.png (845.8 kB)
avatar image guiguimbop Oct 04 '17 at 08:56 PM

alt text

This is a silly solution but it's working* Thanks to the community

solution.png (772.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
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