Concept help - spawning decals/actors on environment based on camera rotation.


Slowly working through learning how to use Unreal Engine from the start, using both Unreal’s tutorials and DigitalTutors. Working on making a horror game of sorts, with more focus on ambient horror than cheap jumpscares. For the most part, development has been going pretty well, but I had an idea that has put me down for close to two weeks without any progress on the matter.

This is my goal - my character has the stereotypical horror flashlight (originality’s hard, eh, 30 degree arc spotlight). What I would like to do is figure out a way to spawn a model that I created/animated of a sort of alienesque eye on the walls/floor/ceiling in the peripheral vision of the player. My goal would be the outside 10 degrees of the player’s vision (where the room would be extremely dark) would constantly be filled with very subtle movement (the kind where you go, ‘eh?’) and whispers, giving it a very surreal feeling. I would like to be able to spawn the objects with a rotation that matches whatever they’re on in order to match the animation, just for aesthetic reasons.

I’m at a loss of where to start. I’ve been reading around and found many things, mostly from FPS tutorials, where you’d use a vector trace to find the wall, get the angle off the wall, calculate rotation of the surface from that, and apply the decal/model. However, I don’t know how to restrict it to specific angles directly from the camera, and I don’t know how to implement it so the things will despawn the second they move in/out of a specified rotation. (I.E., move into the flashlight beam, or out of the camera’s view entirely)

I realize this is no small blueprint task, but I just need a thought to get a foot in the door to figure it out. I’m at a loss here. :L

Any thoughts?

Hey Cipher, I would just use the standard linetrace node and then add an offset to fall with in the 10 degree window you are wanting.

I hope this makes sense. Just do the standard linetrace and find an impact point in the world. This is essentially always in the center of the screen. Then do some math-a-magic to offset that point to the outer edges of the screen. Then spawn your eye at that new impact location. This should push the actor to the edges of the screen. For the animation of the eye, have you thought about creating a dynamic material that blinks for example? you could also randomly set the lifespan or duration to a value. As for the sounds I would just spawn a sound at the location of the eye, or if you want it to be like someone is in your head or wispering into your ear I would just use the sound node that is used for UI.