Download

Need rotation help on on hit impact normal

I have a construction script where I do a line trace onto a landscape to place an instanced static mesh components. I am trying to get the instance to align with the face normal on the impact site and add a random rotation to the instances z axis. I can get the instance to orient to the landscape but can’t get it to rotate around the instances local z axis. I tried combine rotators but that does work. Any help would be appreciated.
onhit.png

Have you tried “Rotator from Axis and Angle”?
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Rotator/RotatorfromAxisandAngle/index.html
I had the same issue in a project I was working on and I was able to get the correct result using this node.

Set Z to 1 and set Angle with your random value.

I tried and could not get this to work. Do you have an example you could post thanks,

I’ve made something that could be of use for you. It projects meshes on surface and then randomly rotates around hit normal.
568067881892bb02968a682f9a2f4568c2b858c7.jpeg
and the result
5d1a206d171dd9aea2adc5d7635de583a721d9b4.jpeg