using UnityEngine;
using System.Collections;
using FSM;
public class Action_walkfoward : FSMAction
{
private Vector3 moveDirection = Vector3.zero;
public float gravity = 10.0F;
public float speed = 3.0F;
public void execute(FSMContext c, object o)
{
moveDirection = new Vector3(0,1,0);
moveDirection *= speed;
moveDirection.y -= gravity * Time.deltaTime;
---->//moveDirection = c.gettransform();
}
}
i created a fsm context that gets the transform and sets it as the direction. what i am trying to do get my character to move on its own the error i am having is converting it. also i am not sure if the way i am doing it will work. this is in my context------
public Transform gettransform()
{
return Controller.transform;
}
public void setcontroller(Transform pos)
{
pos = Controller.transform;
}