CameraController stop the 'snap' behind in third person?

Vlaxep

Active member
Howdy,

I'm switching between player prefabs in an 'AvatarCustomisation' mode, where I have a custom CameraOffset to perfectly pan around the character in 3rd person while the player customises their avatar.

Some changes involve only skin changes, but when there is a prefab change, the camera 'snaps' back to a 'behind' position on the new character once the camera picks up that it is the active character.

As the player will be able to pan anywhere around the character I need to stop this snapping from occurring. I've tried using a 'get' on the last transform of the camera and trying to 'set' immediately after the new prefab appears, but this sadly does not work.

I've also tried unchecking the 'Init Character On Awake' (I don't think this is related to this anyway though).
 
I realised I should mention for my custom 'AvatarCusomisation' view mode, I'm not using a custom view type, simply temporarily modifying the AnchorOffset of the CameraController for 3rd person to the desired amount.

Now going to play around with the 'ForwardAxis' property to see if perhaps setting to Z = 0 while in this view stops the snap adjustment.....
 
Ok so trying something that probably 'should' wor but also not...

- Have an empty object 'CameraAvatarAnchor'
- When character enters 'AvatarMode' the transform of 'CameraAvatarAnchor' gets set to the transform of the 'CharacterObject'
- Upon entering 'AvatarMode' I'm trying to set the CameraController.Anchor to the 'CameraAvatarAncor' object, but it just will not set.....

Trying to do this every frame by Update() but even this doesn't work - it remains set to the characterTransform

Weirdly though if in the editor in playmode I simply drag the object in to the Anchor Property of CameraController is does work....?!?!?!
 
Top