Skip to content
Permalink
99dfade025
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
31 lines (27 sloc) 844 Bytes
using UnityEngine;
using System.Collections;
public class EnemyZombie : MonoBehaviour {
public Ray ray;
public GameObject player;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
RaycastHit hit;
// ray = new Ray(player.transform.position, transform.position);
ray = new Ray(gameObject.transform.position, new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z - 4));
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.tag == "Player")
{
Debug.Log("Hit, hit, damage report");
// transform.position = player.transform.position;
}
else
Debug.Log("No Joy");
}
}
}