Hey Chris,
when you press E both StaticMeshes change because you implemented it like this.
I would recommend that you make a LineTrace and
First:
Make 2 bool Variables. TargetCube1WasHit and TargetCube2WasHit
Then make your Line Trace
Check if the HitComponent is either your TargetCube1 or TargetCube2. If its TargetCube1 set your TargetCube1WasHit to true.
Don’t forget to set the opposite bool Variable to false. In this case TargetCube2WasHit.
Then whenever you press E check if TargetCube1WasHit or TargetCube2WasHit is true.
Of course only one should be true or both false.
Now you can set the Static Mesh
There are more elegant ways but this is the fastest I could think of now
Good Luck