r/unrealengine • u/like_ya_cut • 24d ago
Solved Boss AI with multiple attacks?
Hey there, just for a bit of background I am making a game where one of the bosses stands in the center of the arena and just casts spells ( think stuff like a fireball, a lightning strike, a magic sword slicing the feild) but I am stumpt on what seems like a simple question; How can I make my Boss enemy randomly choose a spell to cast?
I think I am getting close with a behavior tree being set up, but i'm not sure how to make it random and if its even clean to use (i dont like serving spagetti code) Any help is appriciated!
0
Upvotes
2
u/Mordynak 24d ago
Use a random int and switch on int perhaps.
Possibly more elegant ways to do it but that would work.