Hello!
I am currently scripting a rhythm game. Whenever you play a song, it will first load the song map (a module). I have the normal notes working, but the problem I am facing is the hold notes.
I have two points, the note, and the tail note. Both of these points are ImageLabels. What I am trying to achieve is to make a line (frame) that goes between the two points.
Rotation isn’t needed but can be helpful in case I add something later.
I looked for so many possible solutions but they all don’t seem to work out as the line appears in random positions off the screen. Remember that I want this in scale, NOT Offset
I don’t need code, I just want logic. However, code may be useful.
You can do this by subtracting the position from the lowermost object from the uppermost one, then setting the position to the uppermost object.
local lower = script.Parent.Lower
local upper = script.Parent.Upper
local function drawLine()
local line = Instance.new('Frame')
line.Parent = script.Parent
line.Position = upper.Position
line.Size = lower.Position - upper.Position
end
drawLine()
That’s because you have to use the AnchorPoint property. You can either set the AnchorPoint of the line to 1,0 and set its size to 0,0,x - (dot.Size.Y / 2),0 or set the AnchorPoint of the dots to 0.5,0.5 (which would probably be easier )