-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CrossFadeInFixedTime equivilent for state machine. #2252
Comments
Ok, so we're heavily blocked with improving our character controller until we do this, we have so many states that need to have their transitions modified by code ect that the current setup isn't viable, also the lack of transparency of what's happening under the hood of the transition system in dev makes the systems very difficult to debug. I'm looking into how to do it, but it seems to be very clunky with how things are setup. The approaches I'm looking to try is using a similar approach to the virtual one shot animation function, and create a virtual transition and discard it once it's fired. But that has complications as i would need to have a way of specifying what node is the state machine, then building the transition and firing it. I'm happy to spend a few days implementing this, but i'll need guidance on the best way to do it, as i don't fully understand what's going on under the hood, and there isn't many examples of doing something like this in the code base to work from. We can't afford to wait on this feature though, hence why i need to work on it. |
Have you tried using a structure passed to the graph with all transitions - I'm aware there might be a lot states required to handle but with public struct MyTransitions
{
public bool Idle;
public bool Run;
public bool Walk;
} We could implement a similar API to enforce the state via API call (via |
Thanks for replying! Setting the parameters to switch states isn't the issue, we just use an int to do that which is very easy, just one param. The any state node will help things a lot once it's fixed, but that doesn't get around the issue of programmatically setting the transition settings, we can't pass these in as params. And if we can get a way to programmatically change the properties of the transition, we're not using the utility of having a transition graph. There are many times where we want to transition into a state faster given a set of circumstances, and it would be much better to have this be dynamic. Being able to just call change state in code with the settings we want, would greatly simplify our system and prevent us needing to replicate our characters state transitions within the anim graph. |
Issue description:
The state machine while powerful, is limiting to only use the arrows to handle transitions.
Instead what we would like is function like unities CrossFadeInFixedTime function, to allow us to directly set which state we are going to from code.
It might already be possible, if not, i'll probably try and hack it in myself, and do a pull request.
for reference for what We're looking for.
https://docs.unity3d.com/ScriptReference/Animator.CrossFadeInFixedTime.html
The text was updated successfully, but these errors were encountered: