Blueprint root static mesh can't be rotated in Viewport

Hello,

I have been having a problem with static mesh. I have seen a few suggestion around, but I don’t think they are realistic if you would like a dynamic blueprint environment.

So here we are, as the title said, I wanted to rotate a static mesh component, in a blueprint, in the Viewport.
The problem is if the static mesh component is the root, then the option isn’t available (screenshot attached).
If I have the static mesh as a child of a Scene Component, or Collision Component, it does rotate…but will change the Axis of the static mesh…

The weird thing is, if I use the Construction Script where I do a SetRelativeRotation, it does rotate as I want. If I do it in the Event Begin (purely for testing and adding more info here), it works as expected too. (No weird axis changes)

So is it a bug in the Editor UI that I can’t rotate a static mesh if it’s the root component of your blueprint ? And is it a bug that the axis are changed, and so if I move the static mesh, it just doesn’t move along the normal axis of the world, but along its own updated axis rotated

You might be wondering where this is coming from. I might have, wrongly, thought it wasn’t good practice to have a Scene Root, and instead of moving the Scene Root, moving the child Static Mesh Component. When I was moving the Scene Root, it was not moving the Static Mesh Collision though, so it’s a problem for me.

So there are really 2 questions:

  • Is it normal I can’t rotate the static mesh when it’s set up as the Root in the Viewport ?
  • Is there any way to have the collision component or collision of the static component move with the root (whatever is the root) . I use AddOffset, but Sweep doesn’t apply to the children collision Components.


Hey there @Kcrik! So you already nailed it in that when it becomes the root it won’t rotate. This is because contextually it just became the actor itself. There is no higher frame of reference inside the BP other than the root. This changes once in world space where you can use world space or absolute scale.

Yep! Only scale works, but also not as you’d expect. It translates those values

Yep again! Taking a bit of an example from the character controller but this applies in many places, I know it sounds a little backwards. If you are ever needing a collision component to be the actual collision for the mesh instead of the mesh’s collision itself, then that collider should be the root. Depending on how you want to handle it you can even change the collision on the SM you want, but that’s for more specific uses.

Let me know what your use case is exactly and I might be able to tell you best practices.

Hey,

Thanks for replying so fast.

You confirmed all my test. My main issue is because I want to rotate the static mesh…but when I do it on the mesh in BP, it affects the movement.
If I rotate around Z axis by 45 degrees, if I try to move along X axis, it will not move forward but in 45 degrees diagonal.

My question is really…how can I rotate the static mesh, without affecting the axis for movement, and keeping the static mesh collision intact.

I, naively perhaps, thought I would just be able to set the static mesh as root component of a BP, rotate it however I want in space, and not affecting the axis for movement. I originally put the static mesh as a child of another empty static mesh, but that loses collision possibility, and if I set a collision box as root, and static mesh as a child…I can rotate the static mesh, but I have to use the collision box which isn’t practical in many instances as the static mesh will be far different from a box, cylinder or sphere.

I think one question too is…what’s the best practice orientation for static meshes. I read it was X as forward. As a default scene seems to set X as forward, I assume if you don’t want to deal with that kind of issues I’m having, you should make sure all your models/meshes are all with X forward, Y left/right and Z as up/down, is that correct ?

So generally movement (from most movement components at least) is almost always going to be tied to the objects local rotations for components, and actor rotation for roots (which also propagates to components. So if you were intending to rotate something independent of it’s root you’d rotate the component itself and not the whole actor.

So for example, in a hierarchy like this:
image

The cube SM is not the root of the actor, so if I rotate the cube SM itself, it wouldn’t change the actor’s rotation. However if you then rotate the actor it will influence it’s child.

image


You’ve got it right. So generally you want to have X+ forward, Z+ Up, and Y+ Right. This will make importing/exporting much easier. However during export in say, blender, you can change the forward orientation when you export. This can save you time in your pipeline if you had already modeled something complex.

for some reason the collision for projectile stops working when it is not the root element
I don’t know how to overcome this

Hey there @MikelKram! Collisions are handled based on the root object initially. Are you using the projectile movement component? All movement components operate on the root of the actor it’s attached to, so it may be necessary. I would need to know more about your issue and needs before I could offer targeted support there.

This video can help you get a handle on the projectile movement component and explain a bit why the root is what controls the actor there as well.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

1 Like

This happened to me when using a Cylinder static mesh and EventHit was not really working unless the Cylinder was the SceneRoot.
Since you can’t rotate the screen root, just figure out the angle you need to change and on EventBeginPlay setActorRotation:

End up editing and rotating my mesh on Blender, so I don’t need rotation on Unreal.