Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Placing a sprite or line renderer between two points

Discussion in 'Scripting' started by furbilici, Jul 25, 2021.

  1. furbilici

    furbilici

    Joined:
    Feb 27, 2021
    Posts:
    3
    Hi guys, I'm placing two spheres by clicking on the mesh with the mouse. I do these with Instantiate. In other words, I want to place a two-way arrow photo in the form of a sprite between two objects that are clones. How can I do that. Thank you in advance for your help.
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    Code (csharp):
    1.  
    2. marker.transform.position = Vector3.Lerp(sphere1.transform.position, sphere2.transform.position, 0.5f);
    3.