“I mean, no? A FSM you can write in a few minutes. A behaviour tree, definitely not.”
You’re right, sorry, I meant to say that behaviour tree takes longer, I wrote it wrong.
“Why are you asking questions like it’s a school exam? Do you have an exam? What actual problem are you looking at.”
it’s a good question, actually, my goal was to write a character controller, and while I was thinking about how to do it, I saw that state management was a must, so I wanted to know which way would be more correct.
“character controllers should never have any of these involved. The animation for the character controller might want to have a state machine”
Yes, it actually makes sense to create separate components for movement/swim etc. and enable/disable them. However, as you said, a state control is needed.
Most of the time it is enough to enable and disable some components and change some variables with triggering correct animations.
For example
Enable/disable Ik
Change Speed
Change CanJump boolean
Change allowing horizantal movement
When I think about it, hfsm is the most suitable for this because, for example, the main 6 7 components will change according to the state and these 6 7 components will have separate states within themselves.
For example,
GroundMovementState(or component) can have
Idle/Crouching/Crawling/Walking/Running/ states
AirMovementState(or component) can have
falling/walking(moving)/running(fast moving)/paragliding/flying states
So thats why i opened this topic. Why not use behaviour tree to control these instead of statemachine
(By the way, I haven’t used the behaviour tree in a real project other than playing around with it for learning purposes, so please correct me if I missed anything.)
“Unity would probably do better with just some light scripting on top of a list of animations”
Sorry, I didn’t quite understand what you meant here. Are you talking about assigning a script to an animation and changing the necessary parameters when it becomes active?
If so, yes, that could be a good way to go also.