Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[look-at component] look-at attribute does not work when the object is a child of another object. #268

Open
kjkpoi opened this issue Jul 10, 2020 · 0 comments

Comments

@kjkpoi
Copy link

kjkpoi commented Jul 10, 2020

The below code has the problem of look-at component in test_text (a-text) object.
It only makes a problem when a child objects to another object.
Could I solve this problem? I want to use look-at component to child objects.

<body>
    <a-scene>
	      <a-camera></a-camera>
               <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-scene>
</body>

<script>
var scene = document.querySelector('a-scene');
var sphere = document.querySelector('#sphere');
var test_text = document.createElement('a-text');
test_text.setAttribute('color', 'green');
test_text.setAttribute('value', 'Its test');
test_text.setAttribute('position', {x:0, y:2.5, z:0});
test_text.setAttribute('look-at', '[camera]');

sphere.appendChild(test_text);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant