Greetings all, chances are it is simple to fix but can not find the solution hopefully I can help.
What I need is that when my character jump the camera does not jump the sole that moves in the X axis
I’m taking the script that comes with unity SmoothFollow2D and everything works fine except for the comment that the camera jumping jumps well, leave the code to see if I can help.
From already thank you very much to all.
var dampTime : float = 0.3;
private var velocity = Vector3.zero;
var target : Transform;
function Update() {
if(target) {
var point : Vector3 = camera.WorldToViewportPoint(target.position);
var delta : Vector3 = target.position -
camera.ViewportToWorldPoint(Vector3(0.2, 0.2, point.z));
var destination : Vector3 = transform.position + delta;
transform.position = Vector3.SmoothDamp(transform.position, destination,
velocity, dampTime);
}
}