This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PlayerScript : MonoBehaviour | |
{ | |
private Rigidbody rb; | |
//Asignación de variables | |
void Start() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// Aplicar a "enemigo" que contenga: | |
// Rigidbody | |
// Collider (de preferencia usar Capsule o Cube) | |
// En Rigidbody palomear los constrains de Freeze Rotation en X y en Z | |
var Player: Transform; //Asignar el personaje al que seguirán | |
var MoveSpeed:float = 4; //Establecer velocidad de persecución |