using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class HitPoint : MonoBehaviour { public Text txtMsg; public GameObject goTarget; public GameObject goBulletHole; // Use this for initialization void Start () { txtMsg.text = goTarget.transform.forward.ToString(); Vector3 vPos = goTarget.transform.position; Quaternion qRot = goTarget.transform.rotation; //goBulletHole.transform.position = vPos; goBulletHole.transform.rotation = qRot; goBulletHole.transform.position = vPos + goTarget.transform.forward*0.2f; } // Update is called once per frame void Update () { /* Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 100)) { txtMsg.text = hit.point.ToString (); Quaternion qRot = goTarget.transform.rotation; goBulletHole.transform.rotation = qRot; goBulletHole.transform.position = hit.point + goTarget.transform.forward*0.2f; } */ } }