inxs Posted June 1, 2017 Share Posted June 1, 2017 Hi all, I was trying to link my textblock to a mesh but I get the message: "Cannot link a control to a mesh if the control is not at root level" Docu says: "Please note that controls that want to track position of a mesh must be at root level (at AdvancedDynamicTexture level)." But I don't know what that means and how I can fix it. Thank you Jonny Quote Link to comment Share on other sites More sharing options...
adam Posted June 1, 2017 Share Posted June 1, 2017 Did you add your text block to another gui element? If so, try to link the mesh to the gui element that your text block was added to rather than directly to the text block. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 1, 2017 Share Posted June 1, 2017 This means that you have to use advancedTexture.addControl(control) to allow the control to be tracked adam 1 Quote Link to comment Share on other sites More sharing options...
inxs Posted June 2, 2017 Author Share Posted June 2, 2017 Hi guys, thanks for your answer! Indeed the order was wrong. I had to add the control first in order to link it. Before I had it the other way around. this.guiOverlay.addControl(textBlock); textBlock.linkWithMesh(cylX); edit: Another Question: Is it also possible to link the control to a point instead of a Mesh? This way you always have to create a dummy Mesh. edit2: Unfortunatly the PG in the docu seem not to be working http://babylonjs-playground.com/#ZI9AK7#1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 2, 2017 Share Posted June 2, 2017 The correct link is this one. You forget the www http://www.babylonjs-playground.com/#ZI9AK7#1 Yes you can add a point normally. It is a node as a mesh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.