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

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:

Scroll Rect:

1 Like

Also, I’ve messed around with the Items being displayed. Adding a Rect Mask 2D doesn’t work.

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?

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)

1 Like

@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 :slight_smile:
https://twitter.com/Andrew_Ferullo

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

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?

Is this the result you want?

3018717--225456--SvRect01.gif
3018717–225457–TestSVRect01.unitypackage (4.82 KB)

1 Like

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.

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. Screenshot by Lightshot

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.

Your view port needs and image attached to it. The image can be UIMask so that its invisible but it needs an image nonetheless.

4 Likes

Also watch out for canvas content that “Overrides Sorting”; keep the box unchecked unless you are customizing rendering order.

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.

8711898--1177335--upload_2023-1-7_16-42-37.png

2 Likes