Hey guys, just decided to dive into custom code in Webflow and met with a problem.
In my project, I want to use this Matter JS sample from Codepen: Matterjs
I put the HTML code into the embed element and the JS code into the before tag and got the scene shown up. But I can’t interact with it like clicking or dragging obects.
I got no experience in coding so I do not know exactly what is the problem. But I tried to change the code here and there, deleting some parts. Nothing seems to work until now. This kinda make me want to learn coding. But in the mean time, would love to have some help resolving this issue.
I found out what caused the problem. I had a grain element that somehow block the interaction with matterjs. I tried to set the z-index of matter js to above the grain element but it did not work.
What work for me is to put an embed element inside the grain div and set the grain div’s pointer event to none as below