I would like to hide an aframe object using localStorage that is being called onto the HTML code, by manipulating the "visible" attribute.
I've looked through other articles like How can I hide an element with A-Frame?
but it does not work for me.
The following is my code:
<a-obj-model
visible = "localStorage.getItem('carVisibility')";
id="carA" src="#car_obj" mtl="#car_mtl" position="1 1 7" rotation="0 0 0"></a-obj-model>
My carVisibility localStorage is set as "false" and "true", depending on user's input. If I replace the localStorage part with "visible = false;" it works perfectly. However, once I add the localStorage portion, it doesn't seem to connect and work. It's clear it's a syntax error, however, I'm not sure what's wrong with it?