How to make smooth drawing canvas?

yeah it work but i have problem when i move mouse fast this will happen

Thatā€™s why you need to make a line between the two dots. try using AnchorPoint to (0.5,0.5) and using Rotation, but Iā€™d wait until you find someone who knows how to create a line between two points, since I honestly donā€™t know. (Itā€™s prob math.acos(Vector2:Dot())), something like (math.acos(Vector2.new(1,0):Dot(Vector2.new(DirectionVector)))/math.pi*180)?
This just gets the angle between two vector2 directions (I tested it), not sure how well it works but you can experiment with it.

Note that you have to set DirectionVector to (Pos1-Pos2).Unit

Cant you just subtract the distance between Point1 and Point2 to get the length of the line?

Yeah, but thatā€™s for the size, I was talking about rotation. (.Magnitude) is length

can you show me how to write that ? am kinda confused

I just used Vector2.new():Dot(Vector2) that just gets the difference in angle between two vector2.
I saw thereā€™s Vector2.new():Angle() but I never used it and has no documentation :neutral_face:

Edit: after experimenting, Vector2.new(1,0):Angle(Vector2.new(DirectionVector),true) would be perfect for a line. It calculates angle between two vectors.

this is a better solution yall

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.