Connect mesh between two world vectors at runtime?

So I’m trying to create a laser beam effect using a custom model. I want to be able to simply stretch the mesh between two vectors at runtime, but one of the vectors won’t always be the same.
Is this possible? I thought it would have been easier but I can’t find anything on how to do this.

Spline mesh component can deform meshes. Or are you actively trying to avoid using a spline?

As in:

This is using a cube as the beam mesh, scaled down. Would that work?

Oh crud! I thought spline meshes were limited to not runtime. Thank you!

1 Like

So I don’t know why this doesn’t work for me…
This is my blueprint - The major difference is that I’m trying to use another actor in the world as the endpoint rather than a line trace from the cursor:

But my result is this:

It looks like the spline is properly going from the head of the chararacter (supposed to be a giant boss) to the “Base” actor, but the mesh (also on the minions for now since they’re the same parent NPC) isn’t being attached properly. Not sure why that would be.

Oh I did notice something else different… your spline mesh has an ABSOLUTE location. Mine only has Location. I parented it to the spline and the spline is parented to the character mesh

Does it work better now? I never tested it in motion so it might be dodgy. It was more of a proof of concept or mesh deformation.

How does your mesh have an absolute location? I don’t know how to do that

image

It’s this tiny arrow.

Mind blown!
lol

It changed the positions, but they’re still not in the right place and not attached. What version of the engine did you use? I’m in 4.26 and starting to think it’s very broken.

4.25.3, I never tested this in motion, I’ll have a look.

Hmm… Thanks. It’s strange that the spline is connected properly but the mesh is not attaching to it. I should try to re-create this in 4.25 and see what the results are. Anyway, thanks so much for the help. I have to go to sleep for work tomorrow.

I’m just very surprised that it ended up being a giant laser coming out of the character’s head. What a coincidence…

Lol tell me about it!

1 Like

Got it.

Change the Rotation to Absolute on the Spline Mesh Component; it’s attached to the spline that is attached to the character so the whole thing rotates unnecessarily. You probably want to do all of it in World Space, as you do.

image

1 Like

That did it!

My Hero!

1 Like