Skip to content
Discussion options

You must be logged in to vote

Hey so after playing around with it more, I got it to work! However, I was wondering if this is the correct way of doing it? I'm sure there's a more condensed way of doing this, so I figured I'd ask here/Stack, as well as keep playing around with it. Eventually I have to incorporate this into my MERN stack and get rid of the embedded variants. I tried using "if, else if, else" but kept getting errors.

<!-- BODY SELECTION -->
<script type="module">
const bodyMaterial = document.querySelectorAll('.bodySwap').forEach((element) => element.addEventListener('click', swapBody));
    function swapBody() {
      const MV = document.querySelector('model-viewer#helmet')
      const material = MV.mod…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@WadeMorrison
Comment options

@elalish
Comment options

@WadeMorrison
Comment options

Comment options

You must be logged in to vote
2 replies
@elalish
Comment options

@WadeMorrison
Comment options

Answer selected by WadeMorrison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants