1


Currently I was trying to achieve a smooth transition and camera follow when the player was falling.
But, When player falls it either goes :

  1. On Increased Y Damping -> Follow is Smooth, but player is off camera when falling
  2. On Increased Y Damping and also Increasing Y Soft zone Height -> same as the first one
  3. On Decreased Y Damping -> Follow is Harsh, but Player is in camera
  4. On Increased Y Damping and decreasing Y Soft zone Height -> same as 3.

Current Setting with Increased Y Damping and also Increasing Y Soft zone Height.

enter image description here


Current Setting Result :

  • When Player Falls , it reaches the bottom extent of the Soft Zone Y and as the camera focus is off due to player falling, you dont see what is down ahead.
  • Also, when it reaches the ground:
    (i) It snaps quickly to focus the player bringing the harsh movement of the camera follow (if y damping is lowered)
    (ii) And player out of camera(if y damping is increased, as player is on the ground and it will take some secs/milliseconds to focus to the player position).


Player Falling , you dont see what is down ahead
(As lookahead only works on input, and on falling there is no input)

enter image description here

Expectation: (You should be able to see what is down ahead, so that you are prepared already for the next move)

enter image description here

Q: How can we have both smooth transition as well as not loose track of the player when falling ?
I was thinking if we can also enable lookahead for Y when falling, currently it is enabled but lookahead doesnt seems to work on falling.

Q2: How do we limit the y axis of Cinemachine, this may solved the problem.

[EDIT SUMMARIZED]

enter image description here

supernatural
  • 1,107
  • 11
  • 34

1 Answers1

0

@supernatural. So, hey I guess this should solve your problem. In your cinemachine virtual camera. Reset your camera to its default values... Keep your character, for your camera to follow and select framing transposer under Body and Right below it You find Tracked Object Offset decrease it in -y. And dont touch any other settings. So, what this track offset does is makes your player up. Keeping that yellow dot in center. So even when the yellow dot drops in your player always stay up. A example photo pasted down below.

Camera Settings

Example of how you need to offset your player

EDIT:

//Here target is your character
public Transform target;
//offset is how far do you want your camera to follow him i.e., distance you have set between your character and camera.
public Vector3 target_Offset;
 private void Start()
 {
     target_Offset = transform.position - target.position;
 }
 void Update()
 {
     if (target)

     {
         transform.position = Vector3.Lerp(transform.position, 
         target.position+target_Offset, 0.1f);
     }
 }

Youtube: https://www.youtube.com/watch?v=_QnPY6hw8pA&ab_channel=Antarsoft

(or)

https://www.youtube.com/watch?v=2jTY11Am0Ig&ab_channel=Brackeys

IcyThug
  • 78
  • 1
  • 9
  • Hi IcyThug, Currently in the camera setting, `Framing transposer`, was already in use. I have added more details in the scenario. I hope it is more understandable now – supernatural Sep 22 '21 at 08:44
  • @supernatural, don't play with the damping for now. Let it be to its default values (probably 1). You see the option of dead zone width and height right. increase them and fit them to your character size... And also I don't think you need to put your player in look-At as follow is pretty much enough for your character to be followed. – IcyThug Sep 22 '21 at 09:20
  • yeah, playing death zone really helped in smoothing. There is one more issue, when falling you dont see what is below as focus will be at top at that period of time.. – supernatural Sep 22 '21 at 10:30
  • @supernatural i have updated my answer. Try it and let me know is it giving you a desired output. All you do is change the offset in Y. So you make sure your character is always in top... The yellow dot drops down to the soft zone but because you have offsetted your character to top. You character always make sure he is on top or missle to screen. Check the images for reference you'll get an idea. Let me know if this fixes or gives you ur desired output – IcyThug Sep 22 '21 at 10:43
  • I did tried though, thanks for the response. But with this setting, the player will always be in top. I have summarized the problem again in the screenshot. You can view at the very bottom in the edit section. Please let me know for any furthur clarification. – supernatural Sep 22 '21 at 11:59
  • @supernatural. Hey, Sorry I understood what you are trying to do but am not exactly sure how to solve this issue with cine-machine. I'm Updating my answer with a heading **EDIT:** thats with a script that basically hard-locks the camera to your player with the offset preferences you give see if that gives you what you what i mean the smoothness and probably will link a video that i watched long back that i guess should address your problem. I hope those will help you out. Sorry Again. Have a nice day.. Let me know if your solution when you find a fix...Thanks :D – IcyThug Sep 22 '21 at 12:34
  • yeah, resolved for now. Used y offset but had to add a script to manage it by comparing the ground distance. – supernatural Sep 22 '21 at 14:59
  • @supernatural cool... Happy to help! – IcyThug Sep 22 '21 at 17:10