#Part between Parts

1 messages · Page 1 of 1 (latest)

wooden raven
#

local rs = game:GetService("RunService")
local p = script.Parent
local a = p:FindFirstChild("Attachment")
local b = p:FindFirstChild("Hit")

if not a or not b then return end

rs.Heartbeat:Connect(function()
local p0 = a.WorldPosition
local p1 = b.WorldPosition
local diff = p1 - p0
local len = diff.Magnitude
p.Size = Vector3.new(1, 1, len)
p.CFrame = CFrame.new(p0, p1) * CFrame.new(0, 0, -len/2)

a.Position = Vector3.new(0, 0, 0)
b.Position = Vector3.new(0, 0, len)

end) Is my script but the promblem is its not updating correctly or even matching the positions of attachments

rancid maple
#

what are you trying to achieve

weary drum
#

would be nice to know what the point is

wooden raven
#

So I have vfx and in my tower defence there is a hit attachment that changes positions and the starting position Attachment now I have lots of vfx for it so it only appears on a part correctly so I want a part to be updated every heartbeat between the Attachments

#

So just make the part go between the attachments

weary drum
#

im confused do you want vfx to play on the moving part?

wooden raven
#

No I just want the part to appear touching both attachments

#

The part starts at the first and ends at the last

#

facing the direction

weary drum
#

im still just confused on what ur tryna achieve