There is a Spriterenderer from which you want to draw a line to the Image, located in the Canvas. The beginning of the line in Spriterenderer (1 vertex), the end in Image (2 vertex).

  • Canvas naturally screen space? - Stranger in the Q
  • @StrangerintheQ, of course. However, the problem has already been resolved - kislyakoff
  • one
    Then issue a self-response (this is better than the second option), or delete the question for lack of meaning in it. - RiotBr3aker 7:02

1 answer 1

public LineRenderer line = FindObjectOfType<LineRenderer>(); Vector3 vec1 = new Vector3(0,0,0); Vector3 vec2 = new Vector3(1,1,1);//ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ Ρ‚ΠΎΡ‡Π΅ΠΊ line.setPosition(0, vec1)//0-Π½Π°Ρ‡Π°Π»ΡŒΠ½Π°Ρ Ρ‚ΠΎΡ‡ΠΊΠ° Π»ΠΈΠ½ΠΈΠΈ line.setPosition(1, vec2)//1-конСчная Ρ‚ΠΎΡ‡ΠΊΠ° Π»ΠΈΠ½ΠΈΠΈ