I am struggling to figure out how to get Stance IDs to change with the various motions.
For example. I want to change the camera when climbing. I see in the EnumControllerStance.cs the various values. I can also see in the ClimbLadder.cs where it sets the state, but when I run the game the value never changes from 0. Unless I equip the bow... but that is something that is specifically setup.
I guess I kinda expected those state IDs that are already setup to change when the motions change. But they don't and I can not figure out the way to do it. Is this something I need to do myself via scripts, or am I missing something... which is probably true. 🙂
I would love some help with this I can fake some of the camera changes with just calling it when action alias is called, but I need to be a bit more specific than that.
thank you for any help, direction, or guidance anyone can give.
Hey @shooob , I did a couple of tests and the Stance seems to be getting set with ClimbLadder.cs.
There's two scenarios with this:
1. No Actor Core on the character. In this case, the ActorController.State.Stance property is set (through the MotionController.Stance property). I validated that changed to "6" when I climbed the ladder using break-points in Visual Studio.
2. With Actor Core on the character. You have to add a "Stance" state. If you do, that should get set as well.
My tests were based on my demo_Climbing scene. Everything seemed to work ok. Could you try that demo_Climbing scene? If that works, it may be something in your scene. If it still doesn't work, you can send me your scene and I'll try it.
thanks again Tim.
I did some investigating. this is what I found. Please forgive me if I am missing something, I have been an Art Director for 25 years and now about 4 months into learning code and tools in ways I haven't before... Sorry... enough of the disclaimers. LOL
I found the following to be true in the climb demo level and the levels I have been working on as well as a fresh project with only Motion Controller and your camera controller installed, so I assume I am missing some basic understanding of something.
- I am on Unity 2020.2.2f1
- In the climbing demo there is no Actor Core, so I added some DEBUG.LOG code to print out the saved and current stances to the console. I did this for both Climb Walls and Climb Ladder.
- it did print out the correct Stance IDs in all my scenes. So, positive
- When I add an Actor Core and create the Stance State to the Player in the Climb demo, as well as in my levels that have Actor Cores already the State fields labeled as Stance, that field never changes and always stay at 0 (unless I change to ranged attack, then it changes to 2). So even tho the console shows a new Stance ID, that field stays Zero. See attached screen shot.
- I also went through and changed the Valid Actor Stance while the game was running and the only Stance that would allow me to trigger the Transition, was 0. Even if I had the Valid Actor Stance set to the Stance ID reported in the console.
I hope that all makes sense. Again, I feel like I not getting it and missing something simple. Sorry, if that is true. I really appreciate helping me through this. I love the tool and and excited to get experimenting... and stop bugging you. LOL
When I add an Actor Core and create the Stance State to the Player in the Climb demo, as well as in my levels that have Actor Cores already the State fields labeled as Stance, that field never changes and always stay at 0
Is the Actor Core on the same GameObject that the Motion Controller is? I see in your image there's a "Character_Controller" and "Player_Template"... any chance they are on different objects? That would explain it.
I love the tool and and excited to get experimenting... and stop bugging you. LOL
haha... NP. I'm happy to help.
@timtryz Character Controller is the Scene name. It was called Character_Controller_Setup.scene. I am super creative with my file names.
It is on the same object. The Player_Template is the character prefab installed with the motion controller in the __Quickstart area.
Started a new project and did the most basic setup I could. Same results. See attached screen shot that will hopefully answer your question about setup.
Really odd. Can you zip that project up and email it to firstname.lastname@example.org?
One other crazy thought. Unity doesn't automatically update the inspector. Can you resize your inspector panel on the right while you're climbing the ladder? I've been burned by that before.
Hey @shooob , Thanks for that. I found it...
Apr 4, 2020
The MC was updated after that to support the Actor Core states. If you update from the Asset Store, you'll be good.
The latest version is:
Nov 24, 2020
well that's embarrassing. Asset store did not show I needed to update. I will have give it a stern word.
Deleting and redownloading fixed it. Worked first time as desired. Thanks for pointing that out. Not sure why it went that way.
Sorry, for that.
No problem. I'm not sure why Unity didn't report an update was ready. That's odd.
I put this at the root of each of the asset folders. It's saved me a lot of pain. haha.
thank you again for the great tool and the excellent service!