Hello everyone
I have problem to show the coordinate in rectangular info. when I wanted to get the coordinate and show it in rect info I got an error which said that this.text.split is not a function
.
here is my code:
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
var rectInfo = new BABYLON.GUI.Rectangle();
rectInfo.width = 0.2;
rectInfo.height = "40px";
rectInfo.cornerRadius = 5;
rectInfo.color = "black";
rectInfo.thickness = 1;
rectInfo.background = "white";
rectInfo.left = "38%";
rectInfo.top = "-44%";
advancedTexture.addControl(rectInfo);
var labelPos = new BABYLON.GUI.TextBlock();
rectInfo.addControl(labelPos);
scene.onPointerObservable.add((evt, pickInfo) => {
if (evt.pickInfo.hit) {
camera.setTarget(evt.pickInfo.pickedPoint);
console.log("G", evt.pickInfo.pickedPoint);
// impact.position = evt.pickInfo.pickedPoint;
impact.position = new BABYLON.Vector3(evt.pickInfo.pickedPoint.x,evt.pickInfo.pickedPoint.y +20,evt.pickInfo.pickedPoint.z);
labelPos.text = evt.pickInfo.pickedPoint.toString
}
}, BABYLON.PointerEventTypes.POINTERDOUBLETAP);
here is my PG: https://playground.babylonjs.com/#XB49NT#8