Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using System;
- using UnityEngine;
- public class Camara : MonoBehaviour {
- int xKordinate;
- public Transform transform;
- public GameObject gameObject;
- // Use this for initialization
- void Start () {
- transform = GetComponent<Transform>();
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKey(KeyCode.Mouse0))
- {
- Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- if (Physics.Raycast(ray))
- Instantiate(gameObject, transform.position, transform.rotation);
- Debug.Log(ray);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement