Search Unity

[SOLVED] UI appear visually, but is physically somewhere else

Discussion in 'Getting Started' started by egartnuc, Jun 10, 2018.

  1. egartnuc

    egartnuc

    Joined:
    Jun 2, 2018
    Posts:
    23
    Hi,

    To begin with, apologees if this is in the wrong section. I'm kind of new around here.

    So I'm working on an FPS game and I built a UI for it, specifically an Inventory which I toggle on/off (you know how it works).

    The problem is: I hit play button (all is good), I open inventory and I see it (all is good), but when I try to interract with it I can't. However, I noticed in my inventory script (which shows what slot my mouse is hovering over) that sometimes slots would pop in them. So I started looking around more, and I found that the entire Inventory is actually in another location, up in the air.

    So the UI is visually before my eyes. But "physically" it's somewhere else.

    My experience with Unity is limited, which I'm sure you understand already. But any help or suggestions are appreciated.

    Edit/Additionally:

    - I'm using the Standard Asset FPSController.
    - I built the Inventory in a separate project and then imported it.
    - All scripts in the background seem to be running (as evidence by the popping slots etc), I just think there is something wrong with camera or character controller settings.


    Cheers,
    TL
     
    Last edited: Jun 10, 2018
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Just to confirm, do you mean "up in the air" in the scene view? That is normal for a canvas that isn't in world view. It looks "odd" in the scene view, but works as expected, if that makes sense.

    Let us know if it's that or something else. If you see the inventory properly that sounds good, but having trouble interacting could be some other issue maybe.
     
  3. egartnuc

    egartnuc

    Joined:
    Jun 2, 2018
    Posts:
    23
    Hi, @methos5k - thank you for your reply.

    I just figured it out (it's always a good idea to attack a problem while newly awake and have a fresh mind). There was another camera in the scene which somehow messed it up. It's settings, I suppose, with what depth and what not made it so that I could touch some things through it. Very weird, but I deleted it and the problem went away. Along with that I alos made sure that the inventory cam had depth only clear flag and culling mask UI (although I did scroll through those settings before as well).

    I spent 4 hours on this problem yesterday without success, this shows the power of sleep and a little inspiration from fellow likeminded. :)

    Cheers!
     
    TheBooBear likes this.