Forum rules - please read before posting.

Make character run with shift + W

edited May 2017 in Technical Q&A
Hi, I have my character all setup already with its Mecanim animations and everything ready to go, but I'm missing one thing: how can I make my character sprint by pressing SHIFT?

Comments

  • See Section 2.3 of the Manual: you must define an Input in Unity's Input Manager named "Run", mapped to whatever button you want it to be (in this case, "left shift").

    A full list of the inputs available to your game can be found in the Settings Manager.  Information on Unity's Input Manager can be found on the Unity website.
  • Thank you so much ChrisIceBox. I looked around the manual but somehow I missed this I don't know how. :)
  • So, now I am having another problem ChrisIceBox. I have created a Controller Simple Move with Playmaker since I will need my player to have more than the Direct Movement of Adventure Creator offers and when I click an object the animation runs, but the character doesn't actually move. Any idea how I could solve this?
  • You must disable AC's motion control over the character by setting their Motion Control field to Manual.  However, there are lots more things to consider when using another motion controller to control an AC player - see this tutorial as well as Section 12.6 of the Manual.
  • edited May 2017
    ChrisIceBox, I have tried to do that but I'm a newbie with this, for real. Still learning a lot about development. Any idea on how to connect Controller Simple Move from Playmaker into Adventure Creator (my guess is that this Playmaker action is very similar to the Unity one)? If you could shed a (more detailed) light into this would be a big help. Thank you!
  • Well, the thing about this topic is that it's very general - the exact method is different for every game, as every game has different needs.  If you're still starting out I would strongly suggest you rely on AC's movement system for the time being until you're more familiar with it - and then switch to PM-based movement afterwards.

    What is it about AC's movement that is making you want to rely on PM instead?  AC also supports the use of Character Controller components on its characters.

    Simply setting the Motion control field to Manual will be enough to control AC's Player object by other means.   However, you'll notice that you still have control during cutscenes, so the next step is to get your system to recognise when AC is in a cutscene, and prevent player movement during this time.

    As covered in the tutorial, you can check to see if you are in an AC cutscene with:

    if (KickStarter.stateHandler && KickStarter.stateHandler.gameState == GameState.Cutscene)
    {
        // Disable custom movement
    }
    else
    {
        // Enable custom movement
    }


    A custom script on your player could use that code to enable/disable the PM FSM according to whether or not you're in gameplay.

    The next step is to allow AC to control your character during cutscenes.  Again as covered in the tutorial, you can read AC's Player component to work out their intended position / rotation etc and act accordingly - but it's easiest to simply switch the Motion control setting back to Automatic if this is appropriate for your needs.

    I have uploaded a simple script that demonstrates this onto the wiki: http://adventure-creator.wikia.com/wiki/Using_PlayMaker_to_control_the_Player
  • ChrisIceBox I was able to work around it by disabling all movement related to the AC's movement. I need to use a custom movement on the player because the game's view is top down and it has a forced perspective on a fixed camera. Basically the camera only follows the player. It doesn't rotate or spin. And the character has typicial Top Down shooter type of controls, meaning that it's required that he looks at the mouse but doesn't actually follow the mouse cursor when walking and that's what was happening with the AC's default movement. Is there a way I can make this work with AC movement? It would be amazing, but for what I've seen so far it's not possible.
  • Movement and camera are treated separately in AC.  AC comes with a Third Person GameCamera, which can be used to spin around the player - see Section 4.9 of the Manual.  You can try an example in the 3D Demo by loading the Managers from the top toolbar, and then enabling the "Third person camera" Local Variable in the Variables Manager.

    But if you want the player to look at the cursor when not moving, you would indeed need custom movement for that.
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.