Trail Like Part stretching

  1. What do you want to achieve? Keep it simple and clear!
    Im looking to achieve a trail like part that will stretch from the current position to the last one.

The part im trying to mess with is the pink part that you see attached to the saber which i want to stretch
2. What is the issue? Include screenshots / videos if possible!

this is what it looks like. it is small but i cannot find a good way to stretch it out

this is what i want it to look like

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Ive tried looking for anything to do with positioning parts relative from a current position to another.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

This is the script that is being used, currently my problem was that i could not find a good way to stretch it out to the full sabers length. if i do, the part will flicker around due to the rotations being applied in a way i do not want them to.

script for reference:

local L = char[GameSettingsTable.ChosenBlades]:WaitForChild("LeftStick"):WaitForChild("StickModel"):WaitForChild("Left")


local part = workspace.Part
local LP = L.CFrame
RunService.Heartbeat:Connect(function(deltaTime)
	L = char[GameSettingsTable.ChosenBlades]:WaitForChild("LeftStick"):WaitForChild("StickModel"):WaitForChild("Left")

	local pointA =  L.CFrame.Position -- current position
	local pointB =  LP.Position -- last position

	local dist = (pointB - pointA).magnitude
	part.Size = Vector3.new(0.1, 0.1, dist)
	part.CFrame = CFrame.new(pointA, pointB) * CFrame.new(0, 0, -dist/2)

	LP = L.CFrame -- set last position
end)

Sorry in advance if this post is not straight forward as it is my first post.

Why not use a Trail?
Seems like this is exactly what they are designed for.
Try this link too:
Trails | Documentation - Roblox Creator Hub

1 Like

I agree with @scottifly, but your issue seems to be the .Heartbeat connection. Try switching it to .PreRender as it fires every frame.

In my case a trail cannot be used as i need the pink part to be a hitbox

They also cannot be found in get part in part :frowning:

Needs to be Heartbeat so that is a bit delayed