using UnityEngine;
using System.Collections;
public class Cell : MonoBehaviour {
public Camera cam;
public Vector3 mouselocation ;
public float speed ;
private Vector3 direction ;
void Start ()
{
// if ourCamera is null then set the Main Camera to the variable ourCamera
if (!cam)
{
cam = Camera.main ;
}
}
// Update is called once per frame
void Update ()
{
mouselocation = Input.mousePosition ;
mouselocation.z = 10 ;
mouselocation.y = ;
direction = cam.ScreenToWorldPoint( mouselocation ) ;
transform.position = direction ;
}
}
using System.Collections;
public class Cell : MonoBehaviour {
public Camera cam;
public Vector3 mouselocation ;
public float speed ;
private Vector3 direction ;
void Start ()
{
// if ourCamera is null then set the Main Camera to the variable ourCamera
if (!cam)
{
cam = Camera.main ;
}
}
// Update is called once per frame
void Update ()
{
mouselocation = Input.mousePosition ;
mouselocation.z = 10 ;
mouselocation.y = ;
direction = cam.ScreenToWorldPoint( mouselocation ) ;
transform.position = direction ;
}
}