안녕하세요, 3D 개체를 클릭하여 소리를 출력하려고했지만 아무 일도 일어나지 않았습니다.AR 개체를 클릭 할 때 오디오 출력
나는 나의 ARCamera에이 스크립트를 첨부했습니다 :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraTest1 : MonoBehaviour {
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
if (Input.GetMouseButton(0) || Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.tag == "clickableObject")
{
GameObject obj = GameObject.FindGameObjectWithTag("clickableObject");
obj.GetComponent<AudioSource>().Play();
}
}
}
}
}
가 여기 내 Object Inspector 이 일단 ARCamera Inspector
의 난 때와 같이 (도 터치 입력을 얻기 위해 조사해야하는 위치 구현 얻는다 객체가 소리를 만졌습니까?)