You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling entity.setAttribute to change color updates the DOM, however does not render the new color (even when the entity has an element which refreshes per each frame).
var rain = document.querySelector('#rain')
rain.setAttribute('particle-system', {preset: 'snow', color: '#ff0000'}); //color: red
DOM Updated:
["components"]['particle-system']['data']['color'] =[ #ff0000 ], however not rendered.
================
Expected Behavior: change in color via entity.setAttribute results in change in color w/o having to remove the particle-system component from the entity.
WorkAround
In order to get the color to update need to call removeAttribute then setAttribute
var rain = document.querySelector('#rain');
rain.removeAttribute('particle-system');
rain.setAttribute('particle-system', {preset: 'snow', color: '#ff0000'}); //color: red
====================
Additional Info: [debug] aframe component added to force update on each frame, however setAttribute does not behave as expected.
Is this API not designed to update after the page is loaded?
Please advise.
The text was updated successfully, but these errors were encountered:
Problem:
Calling entity.setAttribute to change color updates the DOM, however does not render the new color (even when the entity has an element which refreshes per each frame).
Code Excerpt:
=================
JS
DOM Updated:
["components"]['particle-system']['data']['color'] =[ #ff0000 ], however not rendered.
================
Expected Behavior: change in color via entity.setAttribute results in change in color w/o having to remove the particle-system component from the entity.
WorkAround
In order to get the color to update need to call removeAttribute then setAttribute
====================
Additional Info: [debug] aframe component added to force update on each frame, however setAttribute does not behave as expected.
Is this API not designed to update after the page is loaded?
Please advise.
The text was updated successfully, but these errors were encountered: