Looks like you used “Transform to Z Vector”. that will only work as long as the camera is never tilted sideways at all since it derives the XZ vectors assuming an up vector of 0,0,1 to start. That node was meant to create a tangent basis from vertex normals on terrain and things like that.
If you do a full transform using the camera X, Y and Z vectors it will work anywhere. The bottom half of this image (stopping at the texture sample, the top part is only needed if you are doing a shadow depth comparison and the texture is a shadow depth map):
In the above case “Object Position” is simply the center of the object, and will determine the center of the projection coordinates. Use whatever there.
Object Radius can be changed to equal the size of the texture you want to project.
There is actually a function in Engine\Content (not exposed to the right click search menu) called “BoundingSphere_LightTransform” that I made a while ago to create shadowmaps for unlit materials, but it will likely be replaced by something closer to the above graph which is much more robust. Details on what its used for here:
http://shaderbits.com/blog/custom-per-object-shadowmaps-using-blueprints