Forum rules - please read before posting.

Third Person Camera free rotation without clicking

I am using AC's Third Person Camera and would like for the camera rotation/spin/pitch to be passively controlled by the player's mouse movement. The camera's draggable function works for this purpose, but it requires that a button or click is registered before activating. I would like for the camera's draggable function to be ON rather than OFF by default, with no click or button press required, so that the player can rotate the camera around purely by passive mouse movement. Following with this, the cursor would also need to be hidden and yet not locked in the screen center.

How might I achieve this?

Comments

  • This should be possible by unchecking both Is drag-controlled? and Input requires locked cursor? in the "Misc" section of its Inspector.

    If this isn't the case, or these options aren't visible, what are your AC/Unity versions, and what are your settings in the Settings Manager's "Input" panel?

  • edited December 2024

    I am using Unity 6000.0.32f1 and Adventure Creator 1.82.1

    Those options are available. I did what you suggested and unchecked both those settings under Misc. The issue is that the camera now behaves like a traditional 3rd Person Camera by automatically rotating based on player's forward vector.

    I desire for the camera to never rotate/realign automatically (unless scripted to do so), and by default for the camera to only rotate when the player moves their mouse (horizontal mouse movement = spin, etc...) and without requiring this to be toggled. Whether or not the camera aligns with the player character's forward vector is irrelevant. It's more of a constant freelook.

    To clarify, this effect is almost achievable out of the box with AC, with the only thing in my way being that a button/click is required to activate this "rotating camera mouse draggable" control scheme. I'd like for it to not require being toggled and to be the default.

  • The issue is that the camera now behaves like a traditional 3rd Person Camera by automatically rotating based on player's forward vector.

    To disable any influence of the Player's velocity and orientation on the camera:

    • Uncheck Target speed influences spin? in the Spin panel
    • Uncheck Target speed influences pitch? in the Pitch
    • Zero Target speed influence on distance in the Distance panel
    • Zero Height change influence limit in the Height panel

    Does that give you the intented behaviour, or am I misunderstanding?

  • edited December 2024

    I think there's a bit of a misunderstanding. I've long since achieved and executed your suggestions, and it's very close to what I'm after.

    Where we seem to misunderstand is in the last step of my request. AC's Third Person Camera/GameCameraThirdPerson does what I want it to do...except for the manner in how it orbits around the player. Along with your suggestions I've successfully disabled automatic camera orbiting in the pursuit of isolating camera orbiting to only be controlled by the player's mouse movements.

    AC's Third Person Camera has a great feature called Is drag-controlled? that allows the player to orbit the camera by clicking and dragging with the mouse. You hold down the mouse button and then drag to orbit the camera around the player.

    Great!

    Except that I'd like for this to not require clicking and to always orbit whenever the player moves their mouse. I want it to be enabled by default, so that when the player walks around the scene with WASD and AC Third Person Camera...they can use mouse movement to "freelook" the camera around them.

    In summary:
    1. Attach third person camera to player character DONE!
    2. Disable all automatic camera orbiting DONE!
    3. Enable mouse-driven camera orbiting DONE!
    4. Disable the pesky click/button press that's required to activate the mouse-driven camera orbiting IN PROGRESS!

  • edited December 2024

    If Is drag-controlled? is unchecked, then the Spin input axis / Pitch input axis fields will show. Invoking these inputs will move the camera.

    These should be set to "CursorHorizonal" and "CursorVertical" by default, which are essentially just aliases for the Unity's default "Mouse X" and "Mouse Y" inputs in the Input Manager. If you rename them (either in the Inspector, or in the Input Manager) so that they match, input will rely on the mouse without drag control.

  • Thank you Chris! This is 98% what I was looking for. Turns out I simply needed to change the Input Manager string values to "CursorHorizontal" etc... as you pointed out.

    One last question: the camera orbiting affects the player's forward vector, for example if I rotate the camera to freelook left then the character will also start to walk in that direction. I'd like it if the WASD directional controls were unaffected by where the camera is facing.

    Under AC Settings in Movement, setting "Direct-movement type" from Relative to Camera to Tank Controls actually solves this problem and makes WASD movement independent from camera rotation. But I'm not a fan of tank control! Is there a way to have the best of both worlds here?

    Regardless, if it's a very tough problem to solve then I think I'm fairly satisfied with what I have now. Thanks Chris!

  • Direct movement involves the use of inputs named Horizontal and Vertical. Making sure moving the camera doesn't also affect the camera should just be a case of keeping the input keys used by Horizontal separate to those used by CursorHorizontal.

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.