Look somewhere and enviroment changes

Consider the following:

Here’s an actor with a DeadEndWall (static mesh), TriggerVolume (box collision) and a SweetSpot (sphere collision):

The latter’s collision is set to block visibility because we want to trace against it later on:

And the script in the Wall:

We start interacting with it when the player enters the TriggerVolume. We then trace from the camera forward - so where the player is aiming. If that trace is blocked by the SweetSpot, we spawn something 500 in front of the wall (hopefully far enough that it ends up behind the player). And then close the gate so we don’t spawn more objects.

Image from Gyazo


This is by no means a complete system but it may give you an idea of how to approach creating a feature like this. And there are many, many ways of accomplishing that, surely. My aims here was to make it somewhat modular so you can plop more than one of those anywhere and it would just work.