Hi all. I could really use some help with this school project, and hopefully a portfolio piece:
So, the game is a puzzle room inside of a dungeon or cave. There is a piercing light coming from the ceiling, and the purpose is to rotate the mirrors in order to reflect light until it hits a switch in the wall in the upper right (NE) corner of the room. There are falling boxes from a box spawner that explode on a timer. If the player overlaps the box, the player takes damage. When player health is at 0, the player loses. If the player manages to get the light to hit the switch in the corner and exits the room, the player wins.
I have three major problems:
Problem 1 is that I have a spotlight attached to each mirror that is set to invisible unless the it is hit by the piercing light or the reflect function. If hit by a line trace, the spotlight becomes visible and shoots straight out of the front of the mirror. I’m trying to reset the position of the spotlight and the light cone texture so that is spawns at the right rotation angle and transform as where the line trace hit.
Problem 2 – This is actually the biggest problem I feel. Let’s say I have 4 mirrors reflecting off each other properly, but I decide to rotate the first mirror in the chain, it doesn’t break the reflections on all the mirrors. Only the previous mirror that reflects the light is broken. Mirrors 2 and 3 remain shinning a light forward despite not getting the initial light source coming to it.
Problem 3 – The game crashes. I created an exploding box BP and the root component is a destructible mesh. I’m not sure if that’s why the problem is occurring, but I have boxes that randomly spawn from the ceiling and explode on a timer. After about the 7 or 8th box, the game either completely crashes, or hangs for 3 to 5 seconds before resuming. I did notice that this demo uses a ton of memory and CPU power. It barely hiccups on my gtx 970, but when I try to run it on a slower computer it almost always crashes the game.
Here are a list of major BPs that are causing the problems: