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
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
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.