Hi all I’m trying to build a chase cam for an isometric 2D game using the ortho camera view.
So far I’ve got:
if(ChaseTarget!= null ChaseTarget.transform.position != ChaseTarget.PreviousPosition){
currentPos = Camera.main.WorldToScreenPoint(ChaseTarget.transform.position);
pastPos = Camera.main.WorldToScreenPoint(ChaseTarget.PreviousPosition);
difference = currentPos-pastPos;
moveBy = new Vector3(difference.x/42,difference.y/42,difference.y/42);
transform.Translate(moveBy);
}
the “42” changes if screen size or orthographic size change and is also not very accurate(it looks right at a glance but moves slightly slower than the player) …
If I’m doing this kinda correctly (and I’m not totally sure I am) is there a way for me to calculate what “42” should be based on screen size and/or ortho size as I’m really not happy winging it.