How to execute many tasks with probabilities

Kopekku

New member
I have a behavior for a pet that randomly executes one of many actions when idle, each has its own probability of occurrence. Is there a more effective way of implementing this behavior than the one described in the attached picture? It kind of feels wrong to me the way I'm doing it.

Second question I post today and last, I really needed to get these out of my head.

Thank you very much if someone could help I appreciate it.
 

Attachments

  • Screen Shot 2021-04-11 at 04.42.10.png
    Screen Shot 2021-04-11 at 04.42.10.png
    143.4 KB · Views: 20
Instead of using a Probability Condition you could replace the Selector with the Random Selector.
 
But the random selector uses the same probability for every child task and I need to execute them with a very specific formula based on other variables that change each frame.
 
In that case you could either create a new decorator similar to the Random Selector, or what you are doing now also works.
 
Top