- Home /
Can prefabs interact with scroll rect?
Hello! I have been having some trouble with the scroll rect in my game recently. I have prefabs falling from the top of the screen and I am wanting them to be destroyed on contact with the objects within the scroll rect, but the prefabs just fall right through. I have a destroy script on the obejcts in the scroll rect and I've checked to see that they are on the same layer. Is there something I am missing or overlooked? Also is this even possible when using a scroll rect or is the scroll rect even the correct thing to be using in this situation? Thanks in advance for any advice given or pointing me in the right direction!
Are you attaching 3D objects to your scroll rect what kind of objects do you have in your scroll rect? Is the canvas set to worldspace (becaue you say scroll rect i assume you are using the unity ui)?
No 3D objects are attached, when setting up the scroll rect I only saw the options for using buttons and images...so I am using "images" (just colored blocks) inside the scroll rect. And I did not have the canvas set to worldspace. I changed the setting to worldspace and the "images" in the scroll rect got huge. Do I just need to resize/realign them then I should be good from there?
Hm.. i never tried it but dont forget to assign them some boxcolliders too. Check whether or not there is a collision detection through OnTriggerEnter(Collider coll) and set the collider as trigger in the collider options.
Your answer
Follow this Question
Related Questions
Destroying a prefab on collision with a cube? 1 Answer
Destroying a prefab with a prefab? 2 Answers
Destroy a GameObject 2 Answers
Collision Detection for a Prefab? 3 Answers
How to refer to a collision between clones of the same prefab? C# 1 Answer