Announcement

Collapse
No announcement yet.

How to switch NPC anim after current one finished

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to switch NPC anim after current one finished

    Hello All,

    I have a Market stall NPC and i want it to pick a randon Anim from a set and play it and when it finishes pick another. Currently I have a function on the Charactor Actor and set a varible to a random INT(Figure 1), and a state machine that chooses a anim based on the randon INT(figure 2). I dont think this is scaleable and not the most efficent way of doing this. Also because the Anims are diffrent length the state machine sometimes switches anims in the middle of the current anim.

    any help or a point in the right direction would be appericated.Click image for larger version

Name:	figure-1.PNG
Views:	1
Size:	39.9 KB
ID:	1673380

    Click image for larger version

Name:	Figure-2.PNG
Views:	1
Size:	67.2 KB
ID:	1673381

    #2
    Expose the animation sequence as a pin and create an array with all your animations. Create a doOnce that picks a random animation and resets when you go back to idle.
    Character Customizer

    Comment


      #3
      Thanks! I did a little research into exposing anim sequences and came across the Random Sequence Player node, which does what I need, Thanks again.

      Comment

      Working...
      X