| 1234567891011121314151617181920212223242526 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class BallGenerator : MonoBehaviour
- {
- public GameObject ball;
- private void Start()
- {
-
- }
- private void Update()
- {
- if (Input.GetMouseButtonDown(0))
- {
- Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- Debug.Log(LayerMask.NameToLayer("Ball"));
- if (Physics.Raycast(ray, out var hit, 10f))
- {
- Debug.Log(hit.transform.name);
- }
- }
- }
- }
|