Forum rules - please read before posting.

Rotation problem

Hello everyone,

I have a character set with adventure creator "Player" script using -Mecanim/automatic- and it works perfectly fine, the problem is, I have a custom script attached to the player to rotate the player horizontally left and right using the D-pad but its not rotating. It seems like Adventure creator "player" script is blocking the rotation horizontal, and I figured that out by switching it from automatic/just turning to manual and the rotation worked. However I wish to use the automatic/just turning option while also using the attached script to rotate the player left and right. Is that achievable?

Comments

  • edited February 2019

    When set to Automatic, AC will assume full control of your character. See the Manual's "Custom motion controllers" for an overview.

    If you wish to turn left/right with a custom script in this mode, you can try amending the script to do it via AC's provided TankTurnLeft / TankTurnRight functions in the Player script.

    The other option is to have the script change the Player script's "Motion control" setting at runtime depending on whether or not you want control over it. This can be done by manipulating the Player's motionControl enum value.

  • I tried amending the script but its too difficult for me to understand it. However, no matter how much I tried, AC is still taking full control of the turning. Isn't there any other way to simply not let AC control the turning while still using the automatic mode? I really don't have much knowledge when it comes to scripting. Even tho I decided to not use any other custom script and depend fully on the animation root motion to turn left and right still AC is blocking the turning for me.

  • Isn't there any other way to simply not let AC control the turning while still using the automatic mode?

    You haven't shared your script, but Automatic mode gives AC full control - hence the name. As I said, you can change the motionControl enum at runtime, e.g.:

    public Char myACCharacter;
    void Update ()
    {
        if (myACCharacter.IsTurning ())
        {
            myACCharacter.motionControl = MotionControl.Manual;
        }
        else
        {
            myACCharacter.motionControl = MotionControl.Automatic;
        }
    }
    

    Even tho I decided to not use any other custom script and depend fully on the animation root motion to turn left and right still AC is blocking the turning for me.

    Have you set the character's Root Motion turning slider all the way up to 1?

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.