Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How can Achieve this without gameobject?

Discussion in 'Scripting' started by drmsi, Nov 23, 2020.

  1. drmsi

    drmsi

    Joined:
    May 16, 2016
    Posts:
    2
    [serializefield]

    GameObject gunspawn;

    Vector3 thedirection = Some Value;

    gunspawn.transform.forword = thedirection.normalized;

    Quaternion therotation = gunspawn.transform.rotation;

    I need this value(therotation) without using a gameobject ?

    how can I get the rotation of gunspawn?
     
  2. Erdroy

    Erdroy

    Joined:
    Jan 12, 2013
    Posts:
    19
    drmsi, PraetorBlue and Bunny83 like this.
  3. drmsi

    drmsi

    Joined:
    May 16, 2016
    Posts:
    2
    Thanks a lot very helpful