I usually look for answers by myself but I’m stuck on a “I think” easy issue.
I have a rocket that can turn (yaw) left/right. When it turns, I want it to also slightly rotate in order to achieve some kind of momentum.
The only way I found is to move its origin point (in red below) 70u up on the Z axis in my 3D Software.
This way, the rocket doesn’t turn around its center on the X axis but around this point, which create a circle movement.
A little GIF will speak better than words:
But I’m really not happy with the “hack” I used because this shouldn’t be its origin at all. And I feel like I will run into issues later because of this origin placement. Also, I can pitch. And now, even if it is not visible in game because it is very low, the pitch obviously also follows the new origin which is not at the mesh’s center anymore. And this is wrong.
→ I can’t find an easy way to keep my origin at its center and tell Unreal Engine: “OK buddy, you can yaw based on the origin, you can pitch based on the origin, but you will roll around a point that is 70u up the origin on the Z axis.”
Can someone give me some leads? I found solutions but they all are complicated and always quite off from what I’m trying to do.
I’m pretty sure there is an easy answer to this but I can’t figure it out, even after spending hours trying things.
I can’t put my Mesh as a Children and make it turn around another invisible parent mesh because I’m controlling this Actor with the gamepad. Doing this makes me control the invisible parent instead.
Here is my Blueprint regarding how values are passed to the Actor:
Set or Add translation (not rotation) according to roll angle with sin and cos. If you will use Set then it will be hard dependency, if you will use Add then some delta of roll will cause adding some delta translation
You can put the origin where you want it, but then the mesh to a blueprint and put a scene component where you have the shifted origin at the moment. Then you can still rotate around that shifted point, but the mesh origin is in the right place.
I then made an actor blueprint and added the mesh. Then I added an empty scene component to the blueprint and hung the rocket mesh under that scene, like this:
Why do I have to put my pivot point so high (200u) in UE when in my 3D Software, it gives the same results with the pivot point at 80u. It uses 1u=1cm, isn’t it the same in UE? (also something I read in a tutorial but it could be wrong). Edit: It might have something to do with the camera. Since it follows the Mesh perfectly, it looks like it’s not moving that much with lower values. I’ll investigate. Edit2: Got it, the Arrow is not still and doesn’t rotate around itself but turns around a point between it and the Rocket. Which is not what I’m looking for so I guess my Blueprint is still wrong.
There is no difference in the game behaviour between using the “SetRelativeRotation” or “SetWorldRotation” nodes. I ended up using “SetRelativeRotation” but which one is the right one to use in this situation? Edit: My Blueprint is still wrong so forget about this one.