Spawn actor and align above terrain

Hey,

I definitely think I can help you with that, but I won’t be able to run any tests until later. Here’s an explanation of how you might be able to set that up.

Essentially what this would do is immediately spawn the object with perhaps a ‘preview material’ which is just white color, with some material parameters to change opacity and possibly color. These parameters can be given new values via Blueprint. This object will update it’s location based on where you’re aiming, and can be rotated with a key binding.

It’s going to involve first finding the angle that the surface normal makes relative to the world Z axis (some vector math). Then you can check if that angle exceeds a float that you designate as the limit. You also may want to do a sphere trace at the object’s location to detect any overlap collisions that would mean it can’t fit.

Then based on that you can send new values to the parameters in the material instance to tint it red if it can’t spawn, or to make it less translucent once it has been placed (you could also just swap out the material at this point to the real one if it doesn’t include additional crafting).

If you’ve never worked with instance materials before, they’re not nearly as difficult as they sound, and unreal has some nice short tutorials for how to use them.

But I will try to make some time to test this out later, because I’m also interested in this kind of mechanic. (More inspired by TF2 engineer buildings though).