superframe
superframe copied to clipboard
[template] Position of template object resets to 0
I'm having some issues when applying the following template:
<script id="boxesTemplate" type="text/html">
<a-box width="0.2" height="1" depth="0.2" position="0 0.5 -0.2"></a-box>
<a-box width="0.2" height="1" depth="0.2" position="-0.2 0.5 0.2"></a-box>
<a-box width="0.2" height="1" depth="0.2" position="0.2 0.5 0"></a-box>
<a-box width="1" height="0.2" depth="1"></a-box>
</script>
When applied to an entity the child <a-box>
entities come through, but their position resets to 0:
<a-entity template="src: #boxesTemplate;"></a-entity>
I'm using aframe-template-component
v3.2.1
from npm
Seems like moving the above template into my HTML so it isn't included during the compile step fixes this issue. I'm using this component with ember.js
and ember-aframe
: https://github.com/ember-vr/ember-aframe
@ngokevin same problem here using react and react-dom any idea?
ok a "normal" project works fine glitch.com/edit/#!/kind-scourge
this sample example with react does not work
/* global AFRAME */
import AFRAME from 'aframe'
import 'aframe-template-component'
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<a-scene>
<a-assets>
<script id="clouds" type="text/html">
<a-text class="nametag" value="CLOUDS!" side="double" position="0 2 0" rotation="0 0 0" color="black"></a-text>
</script>
</a-assets>
<a-entity id="sphere" geometry="primitive: sphere"
material="color: #EFEFEF; shader: flat"
position="0 0.15 -5"
light="type: point; intensity: 5">
</a-entity>
<a-entity id="light" light="type: ambient; color: #888"></a-entity>
<a-entity template="src: #clouds"></a-entity>
</a-scene>
);
}
}
export default App;
I'll try to look some time. Feel free to debug the component, it's not too complicated.
any news on this?