- Home /
Question by
dazzopardi · Jan 19, 2019 at 01:21 PM ·
uibuttonsattack
Attacking using UI button when pressed.
Hi All
I am trying to do an attack animation when UI button is pressed using the unity standard assets third person controller scripts and whenever i press the UI button to attack nothing happens because the boolean is not activated while pressing it.
Here is my current script in the Third Person User Controller :
public void Update()
if (CrossPlatformInputManager.GetButtonDown("Attacking"))
{
Attacking = true;
}
and this script in the Third Person Input for when a button is pressed :
public FixedButton AttackButton;
// Use this for initialization
void Start () {
Control = GetComponent<ThirdPersonUserControl>();
}
// Update is called once per frame
void Update () {
Control.Attacking = AttackButton.Pressed;
Can someone guide me what am i doing wrong?
Thanks,
Daryl
Comment