[original question, because this node does the job (more in the thread above)] I would like to rotate objects the same way as ‘RotateAboutAxis’ node from material editor does, but there is no ‘RotateAboutAxis’ node in blueprints. How to recreate the behavior of RotateAboutAxis node in blueprints?
Try using a rotation node and only add or set the rotation along the axis you want to affect. From the add or set rotation node right-click on the rotation pin and then select Split Struct Pin to gain access to the individual axis.
To get the rotation the way you want in your thread post you can use the lookat rotation to rotate them to face in the direction of the object on one rotation and then on a separate rotation rotate them only along the axis you are wanting them to bow.
Then don’t rotate them to face the in the direction of the object, instead from the lookat rotation rotate them only on the single axis to perform the bowing, don’t use the up vector you shouldn’t need it, the pitch rotation towards the object is the one you need to rotate along so the lookat rotation should give you yaw so the bow faces the object and the bobs shouldn’t roll at all so that one isn’t needed either.
Don’t say that, sometimes you just have to step back and reevaluate what is going on. Remember that your bobs are always facing their X axis and their X isn’t the same as world X. The LookAt rotation tells you the direction the bowing needs to happen towards, then you need to get which axis of theirs (the bobs) is facing that LookAt direction and add pitch on that axis only to get them to bow towards the object.
Thanks, sounds promising, I will try this, but I can’t figure out how to get (“you need to get which axis of theirs (the bobs) is facing that LookAt direction”) this axis?
Still can’t figure it out… I know that we can compare two vectors by DOT Product (so I can compare the LookAt direction and local actor direction), but how to get which axis it is - no idea
Then, I should probably use a node like ‘Rotate About Axis’ or something, but I still need the info on what axis of Bob is facing that LookAt direction…
Maybe they need to perform both Pitch & Roll value rotations to be able to bow in the direction, since it probably will be combination of both Roll & Pitch values… But after plugging both Roll & Pitch values, they still don’t rotate correctly, so I don’t know…
Dang…I’m sorry…I had this figured out before in my head and then had to go through some meetings and lost it…Try getting their look at rotation and subtract their look at from their current rotation negate that and then run the bow on that pitch rotation…I don’t think that will do it but try it and let me know what happens
Ok…it shouldn’t be more than one axis…more than one will make them rotate and twist at once…rotating them on their Roll axis will make them rotate to the sides and their feet will go towards the air…pitch will be up and down in the direction they are facing and Yaw will be the rotation of them turning left and right. In their BP are they facing forward in the X axis?
BTW. If I’m not mistaken, the roll rotation should not make their ‘feet’ go towards the air, since they don’t have their pivot point in the middle, but on their ground level (just like in the image)
I just meant by towards the air if you rotated them completely around…I was trying to describe the rotation directions as best I could. Yeah pivot will be at their feet
Final step is almost done…it will need some more tweeking for the Bobs floating in the air:
You may have to use a float select for the floating Bobs…but that will also require a second set of calculations to return their distance up in Z from the world Z of the bob point as a starting point then from that add to the degrees of pitch rotation to add to the bow so they bow beyond flat 90 in the facing direction.