Beispiel #1
0
    void Update()
    {
        Debug.Log("Sound filevv");
        stack.printSound();


        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                if (hit.transform.name == "Rneck")
                {
                    //if the touched gameobject is a body part
                    print("HIT");
                    PlaySound();
                }
            }
        }
    }