I have always had issues with Playcanvas rotations. Today Im trying to match one objects rotation with another but the rotations never match and the entity Im trying to rotate just seems to use any random rotation it chooses.
I have an object that is a child of my camera (Angle_Box). When I click on an object in the scene I want the object I clicked on (this.entity_to_rot) to match the rotation of the Angle_Box. But it doesnt. What is happening?
Ive tried, both local and global and mix and matching but I get the same unpredictable results.
this.angle_box =this.app.root.findByName("Angle_Box");// I want to match my hit_entity rotation to this entity
var box_rot =this.angle_box.getEulerAngles();
rotationEuler.set(0,box_rot.y,0);
this.entity_to_rot.setLocalEulerAngles(rotationEuler);//Just random..doesnt match at all
Note that the Angle_Box is a child of my camera.