Hey guys, hope someone can help me with this rather specific and tricky problem.
I’m trying to achieve a wind like effect on my foliage actors within the material. I’m using the “Rotate About Axis” node to achieve this simple nodding effect. (see above) Ideally I want all of my foliage to use this effect.
Here is what the “World Position Offset” of the material looks like
The only problem is, while using this function for foliage instanced actors, the pivot point of the “Rotate About Axis” node becomes the global foliage actor pivot… (see below) in other words, on an individual hand placed actor this effect works fine, however when using the foliage tool to “paint” foliage the effect breaks.
I imagine there may either be a simple fix for this that I’m overlooking, or no real way to fix this issue.
Use the “object position” node instead of “actor position” for your pivot point.
Edit: As noted “object position” will rotate around the center of the mesh, for a rotation around the object origin use the “object pivot point” node instead.
The simplest solution would be to either change the model in your 3D tool so that it starts at the origin or you can change it directly in Unreal for your static mesh with the “import translation” setting so that the origin is where you want it to be (you’ll have to reimport the mesh for it to take effect, I think).
Not sure I quite understand what you are asking me to do. The current Pivot of the mesh is also where I want it to rotate from, however the “Object Position” node ignores the pivot and instead uses the center mass of the object, adjusting the pivot has no effect. Again if I’m misunderstanding you let me know.
Ah, sorry, you are right, in this case it’s simplest to use the object pivot point node (it’s just a transform of (0.0, 0.0, 0.0) from local to world space).
PERFECT! That worked like a charm, thanks so much witch-dev for the help really appreciated! I’ll add some more screen, for anyone in the future looking for the same solution.
Unreal Engine 5.3 update:
This code in Material (in Shader) returns pivotPoint of mesh (manually placed single mesh) and mesh instance pivotPoint (if mesh instances are placed using Foliage tool, for example). Basically, it is compatible with UE5 Foliage tool.