playMaker

Author Topic: [Solved]Custom Action problem. Getcomponent  (Read 2230 times)

bloodymin

  • Playmaker Newbie
  • *
  • Posts: 31
[Solved]Custom Action problem. Getcomponent
« on: August 18, 2013, 12:11:25 PM »
Now i'm working on with UFPS and playmker

UFPS itself have some issue on their layer setting and there is no feed back on problem .

So, i decide to user playmaker and set some custom action for myself.
What i am trying to do is that when my AI status set target i just want this action to shoot with Vp_shoot component.

First time i made custom action it start shoot just like i want it to be.
But after restart Unity it suddenly keep showing error

my custom action codes is like this.  And I'm noob on programing stuff

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

[RequireComponent(typeof(vp_Shooter))]

[ActionCategory("UFPS")]
public class Shoot_target : FsmStateAction
{

[Tooltip("start shooting")]

protected vp_Shooter m_Shooter = null;

//void Start()
//{
// m_Shooter = go.GetComponent<vp_Shooter>();
//}
public override void OnEnter()
{
// fire the shooter
m_Shooter = GetComponent<vp_Shooter>();
m_Shooter.TryFire();

Finish();
}


}
« Last Edit: August 19, 2013, 02:59:52 AM by bloodymin »

bloodymin

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Custom Action problem. Getcomponent
« Reply #1 on: August 18, 2013, 11:12:01 PM »
It's done by "using power of playmaker "Sendmessage"

Someone in other article remind me about that action.  :)

Thanks playmaker
« Last Edit: August 19, 2013, 03:01:22 AM by bloodymin »