ThirdPerson ViewType warp to last anchor point

AlexxFree

New member
Hi.

The character stands on a platform that can rotate.
As can be seen on (screen 1), the camera looks at the back of the character.
We start the rotation of the platform, the camera turned with the character,
also looks at his back, good .
Now turn the character facing the camera (wasd)
and start the rotation of the platform 180 degrees. To the green square marked by an arrow (screen 2).
At the same time, the camera will sharply pour over the back to the character (apparently to the point of its attachment) (screen 3)
How to remove this jerk to the camera mount point?
I think:
- or the camera should not fly somewhere, only the character should turn.
- or the camera should already be attached to the new position of the character when he is facing and moving with him.
 

Attachments

  • init1.jpg
    init1.jpg
    34 KB · Views: 4
  • init2.jpg
    init2.jpg
    33.4 KB · Views: 4
  • init3.jpg
    init3.jpg
    33.4 KB · Views: 4
I'm not completely following - can you post a video? Are you using the adventure or combat view type? It sounds like you want to be using the adventure view type so the camera isn't always behind the character.
 
I'm not completely following - can you post a video? Are you using the adventure or combat view type? It sounds like you want to be using the adventure view type so the camera isn't always behind the character.


Camera ThirdPersonAdventure
at 30 seconds. I turn the character towards the camera
Next, I start the rotation of the platform by 180 degrees, there is a sharp flight
 
Thanks. Are you able to tell me how to reproduce that snapping within the demo scene? I just tried to reproduce it by changing the rotation speed of the outdoor moving platforms but it worked as expected.

Are you using the Adventure View Type?
 
Thanks. Are you able to tell me how to reproduce that snapping within the demo scene? I just tried to reproduce it by changing the rotation speed of the outdoor moving platforms but it worked as expected.

Are you using the Adventure View Type?

Yes Adventure View Type
I attached the package so that it can be reproduced
1) scene AdventureCameraTest.unity
2) object in scene TestCameraByPlatformRotate
3) after scene started, do not move character
4) just put the camera in a comfortable position, for example, behind the character’s back
5) in TestCameraByPlatformRotate select any context menu (Rotate - 1, Rotate - 2...)
6) spin to the desired target, for example to Rotate - 1
7) Now you need to rotate the character by walking (wasd) about 180, but you can also go to any angle
8) turn to Rotate - 1
 

Attachments

  • AdventureCameraWarpTest2.unitypackage
    48.7 KB · Views: 2
Thank you.

It looks like the character is a child of TestCameraByPlatformRotate. This is going to cause issues with how the character/camera functions - the character should not be a child of the platform. You should instead use the Move with Object ability, or create a new ability that has a similar set of functionality.
 
Thank you.

It looks like the character is a child of TestCameraByPlatformRotate. This is going to cause issues with how the character/camera functions - the character should not be a child of the platform. You should instead use the Move with Object ability, or create a new ability that has a similar set of functionality.

especially does not affect. if you bring them up the hierarchy, this will not change the situation
 
I see. I'm probably not following the logic but looking at this:

Code:
            CharacterLocomotion.SetPlatform(null); 
            //CharacterLocomotion.ResetRotationPosition();
            _transformKinematic.SetPosition(CharacterLocomotion.transform.position);
            _transformKinematic.SetRotation(CharacterLocomotion.transform.rotation);
            CharacterLocomotion.SetPlatform(_transformKinematic.transform);

The platform should be set when the character starts to stand on the platform, and then it should be set to null when the character leaves. This should give you a more continuous motion rather than the immediate snapping that you are seeing.
 
The platform should be set when the character starts to stand on the platform, and then it should be set to null when the character leaves. This should give you a more continuous motion rather than the immediate snapping that you are seeing.

- As far as I understand, the camera is attached to the vector of a look at the character. That is, for example, we look at the back, so the camera "attached" to the back. We turn the character face. The camera does not move, but the camera mount point is still on the character’s back. When we begin to turn the platform, the camera flies to that anchor point on the back of the character.
- If the character is not moved, the camera will always be at its point of bandage and will not fly away.
- You can open the asset and start the scene.

did not understand what needs to be fix?
 
The camera works with the character's platform reference in order to determine the correct direction in order to face. The combination of resetting the platform within the rotation while also changing the rotation value in the editor is likely preventing it from working smoothly. You'll want to change the code so it doesn't need to set the platform within the rotation logic and only set the platform when the character arrives on it.

With that said, I can add this to my to-do list for a use case to support. You should be able to get it working smoothly right now though by changing how the platform is set.
 
Last edited:
Top