Forum rules - please read before posting.

Offsetting advanced third person camera

When I offset the advanced third person camera, the collider does not offset along with it.

Which means the character is able to see through walls.

As an alternative third person camera, I tried to use Cinemachine's Freelook camera, but another problem arose. With direct control movement, the character moves slightly to the right while moving forward which is very annoying.

What can I do about this?

Thank you

Comments

  • Welcome to the community, @rsx12.

    This is by changing the local position of the Camera child?

    Recreated. I'll look into this - thanks for letting me know.

  • edited April 8

    Thank you

    Yes, thats correct

    I would like to bring up another issue- while using direct movement using cinemachine cameras, the direction of the character changes when the camera changes, resulting in the character to go in unexpected directions while moving. Please look into this aswell.

  • I have updated the Advanced Third Person Camera to provide a dedicated Horizontal offset field, which will also incorporate collision.

    As for the Cinemachine camera issue, are you talking about a snap-cut, as opposed to a smooth transition?

    When using AC GameCameras, AC is able to account for this automatically - it will lock the player's direction until the input vector changes by 5 degrees.

    If you're using snap-cuts with Cinemachine cameras, then you'll have to tell AC manually to enforce this lock. This can be done through script with:

    AC.KickStarter.playerInput.cameraLockSnap = true;
    

    If you want to incorporate this into an ActionList, you can place such code inside a public function on a new C# script, attach that script to a new prefab, and trigger that function with the Object: Call event Action.

  • Thanks for the quick update. I tried out the new camera, it is almost perfect but when player is standing next to a wall, they can still see through it a little bit in the corner. This is with horizontal offset 0.5:

    I switched from Cinemachine cameras to standard AC cameras, I noticed that the problem is not exclusive to cinemachine cameras. Using debug.log(AC.KickStarter.playerInput.cameraLockSnap) on Update(), cameraLockSnap is always set to false even when the camera switches.

    I am using the latest 1.70.4 version and this is with a clean install with most of the settings left to default, I am using triggers to switch cameras, direct movement method and mouse and keyboard for input

  • edited April 10

    I tried out the new camera, it is almost perfect but when player is standing next to a wall, they can still see through it a little bit in the corner.

    I'm not too clear on what's going on in that screenshot - can you share some screens of the Scene window (showing the camera and the wall), as well as your full camera Inspector settings? Try raising the Wall separator value, and the Camera's Near Clipping Plane, also.

    cameraLockSnap is always set to false even when the camera switches.

    Does the ActionList that contains the Camera: Switch Action have its When running property set to Run In Background? A requirement for the cameraLockSnap to kick in is that the game cannot be in "cutscene" mode at the time of the camera switch.

  • I'm not too clear on what's going on in that screenshot - can you share some screens of the Scene window (showing the camera and the wall), as well as your full camera Inspector settings? Try raising the Wall separator value, and the Camera's Near Clipping Plane, also.

    Adjusting the camera's near clipping pane fixed it, third person camera working perfectly now!

    Does the ActionList that contains the Camera: Switch Action have its When running property set to Run In Background? A requirement for the cameraLockSnap to kick in is that the game cannot be in "cutscene" mode at the time of the camera switch.

    The actionlist was set to 'Pause Gameplay' - after switching to run in background, no more problem

    Unfortunately, I ran into another issue.

    When the camera switches and the character stops moving, the character turns around on the spot to face the direction of the input relative to the new camera.

    I changed the input gravity to 1000 - initially i thought this fixed the problem, while using a single input, the character stops and does not rotate as expected. However, when I press Horizontal and Vertical at the same time to go diagonally (i.e. both W and D), the character still rotates after stopping. What could be causing this?

  • edited April 11

    I'd have expected the gravity setting to work. To be clear: you're holding down both keys, the camera switches, and then you let go of both simultaneously?

    I'll attempt a recreation. Can you share screens of your Input settings for both the Horizontal and Vertical inputs, as well as your Player's Inspector?

  • Yes, that's correct.

    Because the rotation doesn't happen every single time I am holding down both keys, If I have to guess what is causing it, I would say that, sometimes, there is a millisecond difference in releasing of one of the keys, and as a result, the computer is interpreting that as I want to go towards the direction of the axis that was released late.

    Input manager:

    Player inspector:

  • Thanks for the details - I'm looking into it now.

  • Recreated - though for me it also occurs regardless of any camera lock-snapping.

    It does indeed seem due to the millisecond difference between releasing the two buttons. This difference is registered even when reading Input.GetAxisRaw, which does without any smoothing operations.

    I'll look into applying a workaround into the next release - thanks for the report.

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.
Do NOT follow this link or you will be banned from the site!