Hi! I’m working with Magic Leap, and I’m trying to set an object direction using another direction between 2 raycasted points. I’ve been using this script but it doesn’t get the right direction actually. Thanks in advance.
if (_controller.IsBumperDown == true && lastPressed == 1 && secondsCount >= 2)
{
Debug.Log("Segundo Presionado");
secondpoint = result.point;
var angle = (secondpoint - firstpoint).normalized.y;
Debug.Log("Angulo rotación:" + angle);
var rotation = Quaternion.Euler(0, angle, 0);
objToPlace.transform.localRotation = rotation;
objToPlace.SetActive(true);
}