-
The first thing I would do is add the input behavior to the player character.
- Add input listeners for U and Y key (Fig 1)
-
So the first element I would create is the control panel.
-
Make an actor to represent the control panel.
- The visual geo may be as simple as a box (Fig 2)
- Add a box collision to act as your overlap trigger. (Also Fig 2)
- By default It should be set to overlap dynamic objects such as the player pawn.
- Transform trigger cube to taste.
- Add a text-render component to your control panel actor (fig 3)
- Make sure it is hidden by default (Stil fig 3)
- Add events for actorbeginoverlap and actorendoverlap (fig 4)
- At this point if you toss an instance of the console into your level, the text should turn on and off when you get near it.
- Create new events for raising and lowering to your control panel console. (Fig 5)
- Now you can tell the input events we added to the player character to call the raise/lower events on any overlapping consoles. (Fig 6)
- In the level, you can place the actor you want to move.
- I chose a simple blue chamfer cube.
- Make sure you set it’s transform mobility to “Movable” (Fig 7)
- In the level, place the destination locations you want your actor to move to
- I chose to just add a few instances of a basic actor (Fig 8)
- Back in the console actor blueprint, create variables for the actor you want to move, and the locations you want it to cycle between. (Fig 9)
- Make sure you make them instance editable.
- In the level viewport, select your control console instance, and populate the variables we just exposed with the appropriate instances. (Fig 10)
- Back in the control console’s blueprint, add some math to cycle the destination index of the target location.
- Increment/Decrement the index, and clamp it to valid values. (Fig 11)
- Lastly, use MoveComponentTo, to move the target actor to the destination actor. (Fig 12)
Fig 1
Fig 2
Fig 3
Fig 4
Fig 5
Fig 6
Fig 7
Fig 8
Fig 9
Fig 10
Fig 11
Fig 12