It does't work with Entity who had added 'Text Element' use 'lookAt'

If I use it like this:

// IA5_RL_Door is an entity with ModelComponent
ChangeColor.prototype.update = function(dt) {
       
        var element = this.app.root.findByName("IA5_RL_Door");
        element.lookAt(this.camera1.getPosition());
 }

It works well,But when I use it like this:

// Text_Depth is an entity with Text Element
ChangeColor.prototype.update = function(dt) {
       
        var element = this.app.root.findByName("Text_Depth");
        element.lookAt(this.camera1.getPosition());
 }

I want it always looks at camera,but it does’t work,this is my hierarchy:
image
Could you help me,thank you!

Hi @fengyu,

The text element may be looking the other side and get clipped right now, try rotating it around the y axis after you do the lookAt():

element.lookAt(this.camera1.getPosition());
element.rotateLocal(0,180,0);
1 Like

Wow,It works,I have taken that into consideration,but what I used is ‘setLocalEulerAngles’,may be I should learn the differences between the two functions.
Thank you!

1 Like