Hi!
I have a problem with screenToWorld function
I want to get position of my click on screen and then move my 3d node to this position
But I’m getting the same values with event.getLocation and screenToWorld (using canvas camera)
What am I doing wrong?
console.log("screen ", event.getLocation());
var touchPoint: Vec2 = event.getLocation();
var worldTouchPoint: Vec3 = new Vec3();
this.camera.camera.screenToWorld(worldTouchPoint, new Vec3(touchPoint.x, touchPoint.y, 0.5));
console.log("world ", worldTouchPoint);
Hi linrm!
Thank you for example
Now everything is good and working as expected
But I’m curious about why do I need a parent node to cube with UITransform component. It doesn’t look obvious to me