Reply To: Tasks vs Script control: Recommend approach

NodeCanvas Forums General Discussion Tasks vs Script control: Recommend approach Reply To: Tasks vs Script control: Recommend approach

#8661
Gavalakis
Keymaster

Hello there,

Sorry for late reply.

In my opinion, both ways are equaly correct. Here is some personal advice.
If you are going to have code that you want to use outside of NodeCanvas and from within your game elsewhere, then you should definetely go with creating functions in your MonoBehaviours as you normaly would and then use Script Control tasks. This way you are basicaly building Behaviours Trees on top of your own systems in a non distracting way.

Custom Tasks are best to be created if you want some mini reusable action or condition that is not necessarily tied to some MonoBehaviour on the agent..something more generic, that could be applied and be used with any agent.

So, in my opinion if a custom task can NOT be applied to ANY agent, then it should not be a custom task and you better implement the behaviour within your relevant MonoBehaviour, and then use it with Script Control.

I hope this helps you 🙂
Let me know

Cheers!

Join us on Discord: https://discord.gg/97q2Rjh