Hi!
I’m using Unreal 5.2.1 and I’m trying to draw a line between two actors. I’m not using DrawDebugLine. Instead, first I created a Niaga System Effect but it looks ugly:
So, I decided to do it using a Procedural Mesh. I get the idea from this post 3D Lined Polygon using Procedural Mesh in Unreal Engine with C++ – 3D Developers' Survival Kits.
I have created an Actor component for the procedural mesh, and an actor with this component:
UCLASS()
class MYPROJECT_API APStickActor : public AActor
{
GENERATED_BODY()public:
// Sets default values for this actor’s properties
APStickActor();protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;public:
// Called every frame
virtual void Tick(float DeltaTime) override;UPROPERTY(EditAnywhere)
class UPStickProceduralMeshComponent* LineComponent{ nullptr };};
The Procedural component is just a 2D polygon representing a line:
I’m not sure, but I think the component doesn’t start drawing at (0, 0, 0) inside the actor. Instead, the middle point of the component is (0, 0, 0). In other words, if I place this actor in a level at (0, 0, 0), I will have the half side of the line before (0, 0, 0) and the other half side after (0, 0, 0).
How can I make that component start drawing at (0, 0, 0)?
Thanks!