How to Make a Component's Current Rotation become its 0,0,0 Rotation

In Blender you can press Ctrl-A to “Apply” the object’s transform and make its current rotation = 0,0,0 and its current scale = 1,1,1 without changing the rotation or size of the object. Is there a way to do that exact thing to a component of an actor in UE4?

My issue is when I go to change the actor’s scale in the Z-axis, in-game, every component of the actor changes its own scale in its own relative Z-axis. I feel like I’m missing something very obvious.

But even if you zeroed the actor and then scaled in Z, it would apply to all attached components, no?

Yes, but that’s my problem. I want to add a static mesh to an actor, rotate the static mesh on a local rotation, but have the static mesh scale on the actor’s Z in game rather than the static mesh’s local Z that is based on its local rotation.

How are you doing the scaling? In blueprint?

Is this just one actor attached to another, or are we talking components in a blueprint?

I can’t post pictures until later, but here’s the situation. If I create a pawn blueprint and I add a static mesh to the blueprint. My static mesh is a simple sphere mesh I imported from Blender (so I can flatten it). In the blueprint, I rotate the mesh 90 degrees on the X or Y axis and I make it so the entire pawn changes scale to 1 in X, 1 in Y, and .1 in the Z axis when the space bar is pressed. When I test it in game the mesh flattens sideways in it’s own rotated Z axis rather than the pawn’s Z axis.

So to answer your question it is a component in a blueprint.

Ok, with you.

You have to attach the mesh inside the blueprint with no transform to a scene parent ( I will explain ). Like this:

  1. Put the mesh in the BP, and move and scale it as you want. It now has a non-zero transform.

  2. Compile. Select the mesh component in the list.

  3. Add a scene component, because you had the mesh selected, it will appear attached to the mesh, with the same transform ( that’s the crucial part ).

  4. Drag the scene onto the mesh ( which detaches it ), then drag the mesh back onto the scene ( which makes the mesh the attached child of the scene ). ( This dragging is in the component list ).

If you’ve done it right, the mesh component will now be attached as a child to the scene component, and the transform of the mesh will null ( no transform ).

I think that should work for you. Tell me how it goes.

1 Like

Ok, cool. I’m following you. I’m certainly going to try that when I get home.

I’ll try to take some pics tomorrow when I get off work. I appreciate your help with this. It’s one of those things that seems like it should be very simple, but it ends up taking me days to figure out.

Can you give me a very cut down, simple example? ( with pics ). I can make it happen, but I’m not quite clear about what you want.

Unfortunately, that solution yields the same result. I’ve been doing a bit more research, and I just don’t think Unreal has the ability to do what I’m wanting it to do. I need to be able to reset the original rotation in-game so as to make the mesh’s current rotation become its new zeroed-out rotation, but as it stands, it seems like you can only do this by changing the original rotation in Blender, zeroing it out there (because it can do that), and reimporting the mesh.

I attached two gifs of the problem in my game.

gif 1: When I make the ball flat I have to choose an axis to flatten it on. I always want it to flatten horizontally, so while it is rolling, I reset the actor’s rotation to 0 and flatten it on the Z-axis. The issue is that when the ball rolls so that the red stripe is vertical, it suddenly becomes horizontal when flattened because I’m resetting the rotation of the actor.

gif 2: To correct the rotation of the static mesh I save its world rotation to a variable when the ball is flattened, reset the actor’s rotation to 0, then apply the variable I saved to the static mesh’s world rotation all in the same tick. Now the static mesh keeps the correct rotation, but it flattens along its personal Z-axis rather than the actor’s Z-axis.

I hope this is helpful.

The way I see it, I either need to set the static mesh’s rotation when flattened as its new zeroed-out rotation or somehow change the rotation of the material so that it just looks as though the static mesh is still rotated even though it actually reset to a rotation of 0.

You just need to make the stripe ( in my case, a cylinder ), a child component of the ball:


That’s what I figured. Well, I know what I want, and I’m stubborn, so I’m going to pull some more of my hair out, and I’ll eventually come up with something either really clever or really obvious. Thanks for your help!

Right, see what you mean.

There might some snazzy way to do it with setting component scale to world or something, but I can’t find it.

In the meantime, you could always rotate the pivot in the mesh, I use:

Nope, it’s a fixed thing.

Now rotate the cylinder component 90 degrees on either the X or the Y, scale the actor again, and I think you’ll see my problem.

Can I use this tool to rotate the pivot in-game from the actor’s blueprint? I need to rotate the pivot every time the ball flattens.

Put it here if you find it! :slight_smile:

This was great, thanks. Helpful when having multiple meshes that need transforming with animations in a blueprint.

1 Like