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"

Consecutive actions using the same trigger

Hello community

I'm attempting to construct an animation for VR, that would show the consecutive stages of construction for a pavilion. I am having difficulties with using he same trigger (eg. mouse click) to spawn/set translation of the consecutive pavilion components. I do not want one action to trigger multiple events at the same time, but the same action to trigger consecutive events.

An example of the goal - LEFT CLICK and a wall appears, LEFT CLICK again and a second wall appears. LEFT CLICK a third time and a ceiling appears.


Product Version: UE 4.19
more ▼

asked Jun 05 '18 at 09:07 PM in Blueprint Scripting

avatar image

8 1 4

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

2 answers: sort voted first

I think you can do it all in one level blueprint as there is no special logic needed to be taken care of by the individual meshes (youre just turning their visibility on and off)

For using on transform to animate a whole composite of many pieces I am not sure the best way. probably either use Attach actor or Attachh to Socket OR make all the parts that should move as one be Components of a main one.

I'm not where i can set it up right niw to make screenshots for you.

but for my idea the basic unit is a struct let's call it "BuildInstruction"

{ Static Mesh reference "MyMesh", Transform "StartPlace", Transform: "EndPlace", }

You can create an Array of these in your Level Blueprint and fill each entry manually with whatever Meshes and their associated start and end locations. This will form a group of pieces that will all move at the same time.

Now this next part is where I dont know if my idea will work - eaxh one of these groupings / arrays is to be put inside a single "Master" array. that's thw one the user manually loops through via clicking the button, thereby activating each group array. I dont know if Unreal lets you pt arrays inside arrays but i think it does. I hope it lets you do this nested thing manually because then basically you end up having just one variable "Master Array" in your level blueprint, which has your arrays of "BuildInstruction" structs in each of its index entries.

Well two vars because you need an integer "MasterIndex" to keep track of which group of building pieces comes next.

On mous click you access MasterArray at MasterIndex and pull out the Array there, And then you loop theough that array and in that loop access each Struct and Lerp the World transform of each MyMesh from StartPlace to EndPlace. Also increment MasterIndex so it will do the next group next time the button clicks. All this looping stuff is what your one BuildThingies function will do as response to the button click.

more ▼

answered Jun 10 '18 at 05:14 PM

avatar image

3.8k 18 23 20

avatar image mightyenigma Jun 10 '18 at 05:15 PM

If you can attach or use components to make certain groups all one piece then you can have just one array instead of an array of arrays.

avatar image mightyenigma Jun 13 '18 at 04:37 PM

I'd love to see a video of it in action once you get it working :)

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

to get that type of functionality you are going to want to use a multigate. a multigate executes the exit pins in order, so on the first time the node is called it will execute pin 0, then the second time pin 1, etc. so in your case each time you left click it will fire a pin in ascending order, click 1 = pin 0, click 2 = pin 1.

you could also do the same thing with a variable and a switch node but the multigate is probably easier. but in case your curious the way with the variable is that you have the variable set to zero and every time you have your input you increment the value of the variable and use that number as the index in a switch or select node.

more ▼

answered Jun 06 '18 at 02:02 AM

avatar image

10.1k 33 10 25

avatar image mightyenigma Jun 07 '18 at 09:21 PM

And if you have a TON of steps to the construction, then I'd put all the pieces of each one each into a struct containing it's start and end states (translation or hide/show) and the assets themselves, and put each struct into an array, and put each array into another array. Then you can just run one function that does everything by looping over the arrays and using the information in the structs, and it knows which array to look at and move all the pieces in it, based on which index you pass into the array that wraps around THAT. And each click can just increment the outer array index that is used to access it.

but if you have only a dozen or so steps instead of like a hundred, then use ThompsonN13's technique as it would be more intuitive.

avatar image panhaad Jun 10 '18 at 12:59 PM

ThompsonN13 thank you very much for your reply, this is exactly what I was asking for and it's very useful to know.

mightyenigma, thank you so much because this is not was I was looking for but it is exactly what I needed!!

I would really appreciate it if you could elaborate a tiny bit more, maybe with a couple of screenshots of how to organize this. For example, a few questions come to mind

  • would i set this up in the level blueprint, or create a separate blueprint for each static mesh?

  • if i have let's say an animated buildup of all the layers in a wall, could I then animate that whole constructed wall as one object? (without applying the translation to each individual wall layer)


(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