Question by
Kimone92 · May 09, 2016 at 07:55 PM ·
scripting problemscripting beginnerscript error
Please Help With Script
using UnityEngine; using System.Collections;
public class Enemy : Character {
private IEnemyState currentState;
public GameObject Target { get; set;
// Use this for initialization
public override void Start ()
{
base.Start ();
ChangeState (new IdleState ());
}
// Update is called once per frame
void Update ()
{
currentState.Execute ();
}
public void ChangeState(IEnemyState newState)
{
if (currentState != null)
{
currentState.Exit ();
}
currentState = newState;
currentState.Enter (this);
}
public void Move()
{
MyAnimator.SetFloat("speed", 1);
transform.Translate (GetDirection () * (movementSpeed * Time.deltaTime));
}
public Vector2 GetDirection()
{
return facingRight ? Vector2.right : Vector2.left;
}
void OnTriggerEnter2D(Collider2D other)
{
currentState.OnTriggerEnter (other);
}
}
screen-shot-2016-05-09-at-214838.png
(209.1 kB)
Comment
Best Answer
Answer by TBruce · May 09, 2016 at 08:42 PM
This
public GameObject Target
{ get; set;
should be this
public GameObject Target
{ get; set; }
Your answer
Follow this Question
Related Questions
Displaying Text on Touch Event 0 Answers
Getting weird error message!?!?!? 1 Answer
Error CS1519 1 Answer