Skip to content
Permalink
1049408a75
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
29 lines (24 sloc) 600 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(transform.position, Vector3.forward);
if (Physics.Raycast(ray, out hit))
{
if(hit.collider == player)
{
Debug.Log("Hit, hit, damage report");
transform.position = player.transform.position;
}
}
}
}