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 Why does the object go off the center if I move the camera up or down?

Discussion in 'Scripting' started by dongminghui1313, Aug 22, 2021.

  1. dongminghui1313

    dongminghui1313

    Joined:
    Oct 28, 2020
    Posts:
    4
    Hi! This might be a silly question but I'm really new to unity. What I want to do is to fix an object always in the camera view. I watched some tutorials and all of them said to make the object a child of the camera. But when I try it, the object goes off the center if I look up or down. What is the problem here?

     
  2. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
    Are you sure it is child of camera?Maybe you change local position of that object?
     
    Bunny83 and Yoreki like this.
  3. dongminghui1313

    dongminghui1313

    Joined:
    Oct 28, 2020
    Posts:
    4


    Thanks for replying! It is the child of the camera. And I didn't change anything of that cube.

    I will create a new object and do the same thing. Maybe there is something messed up in the project setting.
     
  4. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
    Last edited: Aug 22, 2021
  5. dongminghui1313

    dongminghui1313

    Joined:
    Oct 28, 2020
    Posts:
    4
    Thanks! It turned out the problem is in my MouseLook script. I used another one then it's fixed. I will go through the tutorial that you recommended.