Procedural Mesh in wrong location
I cannot work out if this is a bug, or if I'm missing something really obvious.
I have an actor that has six Scene Components arranged in a hexagonal formation, one other Scene Component in the centre, and a Procedural Mesh Component which uses those 7 points to draw a simple hexagonal mesh.
When I place my actor at the world origin (0,0,0) this works perfectly. However, when I place my actor any distance away from the origin, the Procedural Mesh Component seems to be inheriting that transform twice. So for example, if I place the actor at (0,0,100), then the Procedural Mesh Component draws its mesh at (0,0,200). I am drawing spheres at the places where the Scene Components are, for debug purposes. This is what it looks like:
I am drawing spheres at the places where the Scene Components are, for debug purposes. It happens with rotation too. So if I rotate the actor -20 degrees, then the mesh appears -40 degrees rotated.
The strangest thing about this though, is that if I debug all the relevant transform information, it seems to be correct. I am doing this in C++, but have wired up a Blueprint function that reports the location of the actor, points, and procedural mesh. Here is an example output when the actor is at (0,0,100):
This data is all correct. The actor, procedural mesh component, and first point (centre of the hexagon) are all at (0,0,100). The other point positions are also correct for drawing this hexagon. The point positions are debugged from the exact place that they are used to draw the mesh section. However, it is actually drawing the procedural mesh an additional 100 units higher up.
I've been pulling my hair out for a whole day now trying to figure this out, it just doesn't make sense. I can't see why the Procedural Mesh Component is inheriting the transform of the actor it's part of twice.
If I spawn an actor into the world which has a Procedural Mesh Component, and use that same point data to draw the mesh it's in the correct place. Why would it wrong if it's a component on the same actor?
Is this a bug? Or am I doing something wrong here?!
asked Oct 17 '17 at 07:12 AM in Bug Reports
It seems like you have set the procedural mesh's actor relative location to (0,0,100), not the world location. Leave the mesh's location at (0,0,0), and only move its parent around.
answered Jan 25 '18 at 09:21 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here