Hi I have a problem iv’e been working hours on.
The Problem is that when my camera follows Object A, Object A appears on the camera just fine. but when
Object B follows Object A, it moves fine but Object B appears to vibrate. Anyway to stop this vibration effect?
Here’s the code i use to move these objects(at least what i feel is the relevant part)
Vector3 direction = (Path[0] - transform.position).normalized;
Vector3 endpos;
if(gameObject == GLOBAL.PLAYER2)
{
if(((GLOBAL.PLAYER1.transform.position - transform.position).magnitude > approachdistance))
transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, Time.deltaTime * 14F);
}
else
if(gameObject == GLOBAL.PLAYER3)
{
if(((GLOBAL.PLAYER2.transform.position - transform.position).magnitude) < ((GLOBAL.PLAYER1.transform.position - transform.position).magnitude))
{
if(((GLOBAL.PLAYER2.transform.position - transform.position).magnitude > approachdistance))
transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, Time.deltaTime * 14F);
}
else
{
if(((GLOBAL.PLAYER1.transform.position - transform.position).magnitude > approachdistance))
transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, Time.deltaTime * 14F);//
}
}
else
transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, Time.deltaTime * 14F);
Thanks in advance