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

ScrollView Problems - GameObjects still showing on outside of viewport (Solved, Kinda)

Discussion in 'UGUI & TextMesh Pro' started by F3RULLO14, Mar 17, 2017.

  1. F3RULLO14

    F3RULLO14

    Joined:
    Oct 14, 2013
    Posts:
    57
    Hello, my problem is exactly what the title says.

    I'm looking to create a list of recipes for items basically. Everything works fine but I'm having issues with the displayed item still rendering when its clearly outside of the Viewport of the ScrollView.

    Please note I've looked all over the net and nothing has caught my attention or seems to have solved my issue. If anyone has a potential solution or idea on how to fix this, I'm all ears.

    Example:
    http://prntscr.com/el85iw

    Scroll Rect:
    http://prntscr.com/el86ux
     
  2. F3RULLO14

    F3RULLO14

    Joined:
    Oct 14, 2013
    Posts:
    57
    Also, I've messed around with the Items being displayed. Adding a Rect Mask 2D doesn't work.
     
  3. IamShadow

    IamShadow

    Joined:
    Mar 18, 2017
    Posts:
    1
    Your question is almost exactly what I am also trying to do, but I am trying to use the ScrollView for storing inventory items. The few tutorials that exist about ScrollViews are completely not understandable and some are outdated kind of. It makes no sense to me why ScrollViews have to be so confusing... You might have a better chance of reply on the unity help desk than the forums, people get back a lot faster there.

    Also, are you the F3RULLO14 that made craftingdead/countercraft? Or are you just using his name lol?
     
  4. mikael_juhala

    mikael_juhala

    Joined:
    Mar 9, 2015
    Posts:
    247
    As far as I know, the viewport doesn't affect rendering, but simply represents the input area.

    How have you constructed the items? If they are using anything that inherits MaskableGraphic, the RectMask2D should work just fine. (Also make sure the items are under the RectMask2D in hierarchy)
     
  5. F3RULLO14

    F3RULLO14

    Joined:
    Oct 14, 2013
    Posts:
    57
    @IamShadow I haven't found a fix yet and yes. I developed Crafting Dead and Counter Craft. Now working on a Standalone for Crafting Dead. You can check out the game on my twitter feed :)
    https://twitter.com/Andrew_Ferullo

    @mikael_juhala Ill give it a shot and mess around, thank you for the tips.
     
  6. F3RULLO14

    F3RULLO14

    Joined:
    Oct 14, 2013
    Posts:
    57
    This problem is still occurring, am I missing a script or etc to attach to the 3d game object in order to make it maskable?
     
  7. XiongGuiYang

    XiongGuiYang

    Joined:
    Sep 5, 2016
    Posts:
    14
    Is this the result you want?
     

    Attached Files:

  8. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Okay, you need a mask on the viewport. You need to make sure the 'content' panel is larger than the viewport, if you want it to be scrollable. Anything beyond the viewport's dimensions should be cutoff by the mask.
     
  9. F3RULLO14

    F3RULLO14

    Joined:
    Oct 14, 2013
    Posts:
    57
    I created an alt solution to the problem. Whenever a slot gets out of the view ports window, I have the slot disable and enable the GameObject with the 3D model in it. http://prntscr.com/esb7jo

    Thank you everyone for the help! If anyone else comes across this problem, try setting up a system that calculates the slots Y to check if its in the view port or not. If it is, set the 3D model GameObject to active.
     
  10. Brandooh

    Brandooh

    Joined:
    Apr 12, 2018
    Posts:
    1
    Your view port needs and image attached to it. The image can be UIMask so that its invisible but it needs an image nonetheless.
     
  11. MarcSpraragen

    MarcSpraragen

    Joined:
    Jun 29, 2020
    Posts:
    8
    Also watch out for canvas content that "Overrides Sorting"; keep the box unchecked unless you are customizing rendering order.
     
  12. unity_DAE4AF26674353E276C2

    unity_DAE4AF26674353E276C2

    Joined:
    Nov 21, 2021
    Posts:
    1
    Had an issue of button outline (as image component) still visible (when scrolled out of the viewport)

    I found ensuring the checkbox for "Maskable" is checked for the Image Component atatched the Game Object within the content object.

    upload_2023-1-7_16-42-37.png
     
    Last edited: Jan 7, 2023