using System.Collections; using System.Collections.Generic; using UnityEngine; public class cs05 : MonoBehaviour { // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { Ray ray1 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit1; if (Physics.Raycast(ray1, out hit1) == true) { if(hit1.collider.name == "FantasyBee") { this.gameObject.transform.Translate(0, 0.2f, 0); } } } } }