Forum rules - please read before posting.

Problem with movement when switching cameras

Hey i'm pretty new to adventure creator and got a question about switching cameras.

in the manual under "Direct Movement," it says "If the camera cuts to a different angle, he will continue his direction until the user changes the input – this prevents the player moving in an unintended direction if the angle changes sharply."

i've got a simple scene set up to test this, using a trigger to switch the camera. but when i enter the trigger and switch the camera, my previous movement direction isn't continued until the next input. instead it changes instantly and sends me backwards. i'm sure it's something pretty simple, but i can't figure out what i'm doing wrong.

here's my movement & trigger settings

https://imgur.com/a/uCoNLb6

here's a clip of the problem

thanks!

Comments

  • Welcome to the community, @bilnon.

    The details shown in the screenshots look fine - what are your AC and Unity versions, and are you using a keyboard or a controller for input?

    After a camera-switch, the direction change should kick in once the input angle changes by the amount set in the "Max camera lock angle" slider - which I see you've maxed out already.

    We'll need to work out if this is an issue with your Player, or with the input. Try dropping in the 3D Demo game's Player prefab, Tin Pot, into the scene to override your own for the moment - does the issue remain?

    If so, a bit of script debugging will help pin things down. If you open up AC's PlayerInput script, look for the code around line 1402:

    cameraLockSnap = false;
    

    Just below it, copy/paste:

    Debug.Log ("End snap " + newMoveKeys + ", Old: " + moveKeys + ", Mag: " +newMoveKeys.sqrMagnitude + ", Angle: " + Vector2.Angle (newMoveKeys, moveKeys));
    

    Similarly around line 1423:

    cameraLockSnap = true;
    

    Copy/paste underneath:

    Debug.Log ("Begin snap");
    

    Adding these lines should then cause messages to output in the Console when the snapping effect begins and ends. Run your test scene and clear the Console. Pass through the doorway as in your video, and then share any messages that then show up. I'll see if they can help shed any light on the issue.

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.