sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
void FixedUpdate()
{
GetComponent().MovePosition
(GetComponent().position +
Jogador.transform.position);
}
public class ControlaInimigo : MonoBehaviour
{
public GameObject Jogador;
public float Velocidade = 5;
// Use this for inicialization
void Start()
{
}
//Update is called once per frame
void Update()
{
}
void FixedUpdate()
{
{
Vector3 direcao = Jogador.transform.position - transform.position;
GetComponent<Rigidbody>().MovePosition
(GetComponent<Rigidbody>().position +
direcao.normalized * Velocidade * Time.deltaTime);
}
}
}