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.
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.
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.
You have to attach the mesh inside the blueprint with no transform to a scene parent ( I will explain ). Like this:
Put the mesh in the BP, and move and scale it as you want. It now has a non-zero transform.
Compile. Select the mesh component in the list.
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 ).
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.
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.
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.
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.
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!