Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Line Of sight like bubble shooter.

Discussion in 'Scripting' started by A_never_kill, Mar 4, 2015.

  1. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81
    Hi All,

    I am working on the bubble shooter like game.I have to make line of sight for aiming.Please share your ideas.
    Looking forward to your ideas.
    Thank you in advance.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,514
    raycast
     
  3. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81
    But how ? ? Any source code?
     
  4. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81
    I have to draw line with line renderer,Now my line is drawn as drawline So that draw line is not visible in the device.I Have to make that line visible.

    MY code is
    usingUnityEngine;
    usingSystem.Collections;

    publicclassReflect : MonoBehaviour {

    publicTransformborder;

    voidUpdate()
    {
    Vector3dir = border.position - transform.position; //Createvectorwhichfacesthecubefromemptygo.
    Vector3dir2 = Vector3.Reflect(dir, Vector3.right); //CreateanothervectorthatreflectsthatvectorinXaxis.
    Debug.DrawRay(transform.position, dir, Color.red);
    //Debug.DrawRay(border.position, dir2, Color.blue); // Debugtoseetheresults
    }
    }
     
  5. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
  6. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81
  7. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
  8. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81