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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question I am trying to make my shotgun follow the direction I am facing but I have absolutly no clue on how

Discussion in 'Scripting' started by AryaIsMe, May 14, 2021.

  1. AryaIsMe

    AryaIsMe

    Joined:
    May 11, 2020
    Posts:
    9
    Basically I want to make my gameobject to always be in the camera. Currently it rotates with me on the X-axis but not on the Y-axis and I don't know how to make it rotate on the Y-axis.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    Usually you parent things you are carrying to a point on the thing carrying it (camera or otherwise).

    That way when one thing rotates, the children rotate too.

    There are other solutions but they have different code and setup requirements.

    You could try working through a few different tutorials for the style of game you are doing to see how they do it.
     
    Joe-Censored and AryaIsMe like this.
  3. AryaIsMe

    AryaIsMe

    Joined:
    May 11, 2020
    Posts:
    9
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unfortunately, the people with the most Unity experience likely have not run a Unity tutorial in many years, and would have to google your question the same as you.
     
    devon_d and Kurt-Dekker like this.