Sunday, October 26, 2014

Push Mirror

So I took the pushable block and turned it into a mirror.  I think when I first posited this idea, I figured I'd be having the shaft of light spawn a second shaft when the mirror passed into it.  Simple enough, unless you need to make the mirrors turn around as well.  Instead, this mirror produces a shaft when it enters the light and puts it away when it leaves.  This way, the reflection can be redirected when the mirror turns.

Granted, there are issues when a pushable object is also turnable, but I assume that can be fixed or circumvented easily.  First, let's take a look at our mirror.


You may notice a couple of additions to the push sphere.  First is the box on top to act as a trigger volume to detect the light.  Actor Overlap wouldn't work with this for some reason.  Next, if you look carefully you may notice the cone hidden inside the sphere.  Using add component like with the shaft worked fine, but I couldn't figure out how to subtract it once it was there.  I could, however, use Destroy Component to get rid of the sphere itself.  Just so you know we can do that sort of thing.


Instead, we're using Set Static Mesh.  Now that I think about it, if the light isn't a static mesh this won't be very useful.  Hopefully, there's a counterpart for whatever we do end up using.  Anyway, Set Static Mesh changes the static mesh of the target object, and has a pull-down menu so you don't need some other widget to set that.  I set the target of the command by dragging the cone from Components list into the Target slot of the command.  OnComponentEndOverlap then triggers the command again with instructions to turn it back.

Let's see it in action:


The other doodad there is just to set off the overlap commands and doesn't have any actual commands of its own.

Next I tried making a destructible mesh, but I didn't think it warranted much explanation.  All you have to do is right-click on a static mesh in the content browser (I made a copy of one first, though I don't think it will be necessary) and select "Create Destructible Mesh."  It also opens a special editor window for it, and there's a tutorial there, too.  I tried testing it out, but I don't know how to cause damage with My Projectile yet.

No comments:

Post a Comment