Topic: Body part visibility duration

Greetings Forum.

I was wondering if anyone has figured out how to add duration(seconds) to the body part visibility. i want the body part to to stay
visible after the move is complete. Could anyone point me in the right direction. thanks for any assistance.

Share

Thumbs up Thumbs down

2 (edited by Mistermind 2022-12-04 17:52:54)

Re: Body part visibility duration

For this functionality in specific I think its best if you use your own logic for the job.
Body part visibility is just a shortcut to "SetActive" the linked game object:

gameObject.SetActive(true);

What you could do is create an external script, attach it to your character prefab, and use an event handler like "OnMove" and set a specific body part on and off:

    GameObject bodyPart; // or whatever game object you want to toggle activity

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

    void OnMove(MoveInfo move, ControlsScript player)
    {
        if (move.moveName == "Make it invisible")
        {
            bodyPart.SetActive(false);
        }
    }

For more on coding and events checkout this page:
http://www.ufe3d.com/doku.php/code#global_events

Edit: You can also use the "OnBodyVisibilityChange" event for that:

void OnBodyVisibilityChange(MoveInfo move, CharacterInfo player, BodyPartVisibilityChange bodyPartVisibilityChange, HitBox hitBox)
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: Body part visibility duration

Are you looking to enable or disable an object on a certain frame of a move?

Share

Thumbs up Thumbs down

Re: Body part visibility duration

This is much appreciated @Mistermind I will take this approach and post my results.
@Freedterror, no i just want a bodypart to stay visible for a few seconds after a move is
done. but a think i can work it out from here. Im an artist im not very good at coding,
i just need to be pointed in the right direction sometimes. LOL Thank you both for replying.

Share

Thumbs up +1 Thumbs down