Do something randomly in game time to time (like scratching)
I am wondering how can i make enemy AI to do random things? I need to make my wondering AI to scratch and moan randomly. Where shouls i put the code (blueprint). I have tried to put code in Character blueprint and in TICK event i created random int between 0 and 50 in every tick. Then if number is 0 it plays animation. It kinda works, mut there is fails there also.
If i go near NPC the behavior tree starts to take over and NPC walks towards me, it should not play the animation anymore but it will. Also when the npc is near me it still plays animation randomly because tick never ends. Is there a better way to do what i am trying to do? Should i use interface to pass boolean values between blueprints or how should i go on?
asked Sep 12 '14 at 06:59 AM in Blueprint Scripting
Use Set Timer and plug a random float into it.
Then use conditionals such as "Is player in range" to determine whether another set timer is scheduled after the last executes.
answered Sep 12 '14 at 07:08 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here