Topic: How can move activate a script

I would like a special move to activate a C# script.
I have successfully implemented an "OnInput" listener, but I would like to have it only activate when one character uses a move.

protected virtual void OnInput(InputReferences[] inputReferences, int player)

What is the best way to listen for a button press via move?

Thank you

Share

Thumbs up Thumbs down

2 (edited by apollo 2023-01-14 12:51:29)

Re: How can move activate a script

I add the script in my character's prefab and in the first frame of that special move's animation, I add the function of whatever I want to do from the script.

Share

Thumbs up Thumbs down

Re: How can move activate a script

Use the OnMove event:

    void Start()
    {
        UFE.OnMove += this.OnMove;
    }

    void OnMove(MoveInfo move, ControlsScript player)
    {

    }

http://www.ufe3d.com/doku.php/code#global_events

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

Re: How can move activate a script

How can i get through a script the stage and position of a character?

Thanks!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.