Forum rules - please read before posting.

Adding Extra/Costume Animations like Sneakwalk or Sitting

First of all i must thank Adventure Creator team and the Creator of this great piece of Coding Art.
It is a great adventure game by itself.

I am useing 3D , with Direct method using mouse for interactions and keyboard for chrachter controller.
I am working on Unity 20.3.30f1 with Last version of AC.

I ve already used The Movespeed method, which i learned through AC tutorials.
I have also read 2.3 of Manual.

Better say i am zero on C# code. Maybe i just have a little brain to edit some codes in a simple level. not much.

What i am trying to do is Adding Some personality to my charachter with giving her abillity to Sneakwalk and Also Sit/Hide when needed or when she does not want to talk with an aproaching npc.
I would like for example to use input key Alt+Horizontal X Axis key so she sneakwalks.
Or when the user presses the H key , the player could sit on her feet.
I use some more motions through action list costume animation. but i was wishing to add this two animations to the Player.
I thought i better not to add some third package to do this and then Adopt it with AC(as i see in forum)
Any hints? tips and tricks or any solutions for it??

thanks

Comments

  • Welcome to the community, @Bedroomdev.

    The Character: Animate Action can be used to control playback of other animations in your character's Animator. The Engine: Control Timeline Action can also be used to control Unity Timeline tracks that can be set up to animate characters.

    You can use AC's "Active Inputs" system to run ActionLists when the Player presses a button. Though, when it comes to something like crouching, you typically want to rely on custom scripts as you'll also need to affect things like the Player's movement speed (so that they move more slowly when crouching).

    Such a script can be found on the AC wiki here. Though it mentions First-person, it's not strictly necessary - and you can use it for third-person games as well. Ignore the mention of First Person, but do configure the Crouch Mecanim Bool Parameter so that crouching can be animated.

  • Thank you.
    I will follow the link and the instructions. hopefully i can manage it to work.

    Yes i already use parameters and Actionlist to get animations i need on occasions . but my problem was exactly somethings like Crouching speed, since walk speed and crouchingspeed are different.
    So i better go and try the method you just mentioned.
    Regards

  • OOOOOOOWWWWW , I could use Active inputs.... Amazing. never thought about that.

  • edited May 2022

    Sorry . i read that i must not put images unless you ask for them. but i thought it is neccessary here to show what i have done ....

    I tried to do the instruction from the Link.
    I made the C#script and Toggle key....
    I can not understand how to add Collides and Box trigger.
    When i add to Capsule collider Component to one Object( Player) how i can label them Normal and crouch???!!!
    I could not get some things.
    I also added an EmptyObject as Camera parent!!!!
    Totally Wrong???

  • edited May 2022

    Just found AC 2.5D tutorial. at 1h 11 seems it is explained there.
    https://youtu.be/KwsO2vtjCyw?t=4217
    I am going to watch it and will be back with success report.

  • i read that i must not put images unless you ask for them.

    Images are always welcome - indeed encouraged.

    When i add to Capsule collider Component to one Object( Player) how i can label them Normal and crouch???!!!

    You don't need to - the script will automatically disable the "crouch" collider when the game begins.

    I also added an EmptyObject as Camera parent!!!!

    You do not need to - this is an optional field only for first-person characters.

    Just found AC 2.5D tutorial. at 1h 11 seems it is explained there.

    The videos' method makes use of Unity's Root Motion feature to handle the slowing animation. You'll have to switch your Animations to ones that use Root Motion in order for this to apply 1:1. However, a simple custom script would be able to control the movement speed instead, if you prefer this approach instead.

  • Hi again. It kind of works now. super

    I still have a little problem which i can not find a solution for.
    it comes from my lack of Experience and lack of understanding the core of Unity and C#. I know it.
    Maybe you could help me?
    One is The Crouch has some problems.
    1-speed of crouch Movement (I played with it in Inspector but i could not match it up with speed of animation... i will do my best ,even after this comment.
    2- if i press "ctrl" key without WASD it starts to do a strange loop. while moving slowly.

    I know i must also make transition from Crouch to Standing. I will do it.

    As you see in the video , I also have one big problem which i could not find the solution for it. My character stille moves/Slides when Landing animation is in exacution. It was great if i could stop the character from moveing when it is landing.
    All this you could see in Video i uploaded.

    --- In the Video one time i show with Game mode maximize to capture better video. then i minimize to show my settings and inspector/animator conetent so you see what i have done.
    https://rumble.com/embed/v12o4jn/?pub=w6auz

  • Do bear in mind that if you're looking to create platform mechanics, you are best off relying on a dedicated motion controller for it and connecting it with AC. A tutorial on this topic can be found here.

    The above issues, however, can be solved by relying on Root Motion for your animations.

    Root motion causes character movement to be synced with the animation it is playing, so a crawling animation could have them move slowly, and a landing animation could have them stop completely.

    See Unity's documentation on Root Motion for details on how to set up your animations to rely on it.

  • I prefer Relying on Adventure creator. so if needed i will limit my expectations to the possibilites.
    My work is an adventure game. in fact a Trilogy made of 3 interconnected games.
    it is why i thought lets first make the Player as symphatic as possible.
    I will go try root motion.
    It means i must first make my Animations with moving a distance, instead of a making the Cycle alone.

  • edited May 2022

    Thank you for the Script.
    I could Setup the Crouch with out going to Root motion.
    All is fine now and i am near to start making my game( i have made half of My first Game but i started it again after i found AC)

    As you might have time to see in the recent video i uploaded.
    when i push X (crouch key) the crouching starts. and when i push again it ends.
    But there is one small bug with my work.
    If the charachter is walking and i suddenly press X key.
    It reduces movement speed as expected but it does not run the proper animation so it seems very bad.
    In fact I would love to limit crouch start only when the player is idle.
    I mean how is it possible to limit the user. so he/she can only start crouching if the player is in idle mode. so nobody can just switch from Walking or running to Crouching. It will stop the user to experience such weird situation. THe weird situation starts at 0:34 of the Video. when player walks and i(user) press crouch button while normal walking.
    https://rumble.com/v15aj2b-may-19-2022.html
    I totaly understand it is not an Adventure creator Problem.

  • It reduces movement speed as expected but it does not run the proper animation so it seems very bad.

    This'll be a case of making sure that your "Crouch Bool" parameter is set to transition to the Crouch animation while the Player is playing the walking animation. The parameter value itself should be correct.

    I mean how is it possible to limit the user. so he/she can only start crouching if the player is in idle mode

    The script can be amended to only prevent its Crouch function from running if the Player is moving. Replace the line:

    if (player != null && player.IsGrounded ())
    

    with:

    if (player != null && player.IsGrounded () && player.charState != CharState.Move)
    
  • Appreciate your time and support Chris! :)

    I should ,maybe, give this report:

    Last night after 3 hours of changing the settings and combinations, no coding naturally :D, I could solve it all, using ac and unity visual interface and transition/Blendtree game. :D o:)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.