Answer the question
In order to leave comments, you need to log in
Where does the backlash of the camera come from when observing clones of an object?
There is a main unit in the scene that can capture the spawn that creates clones of it.
When you click on the created unit, the "control ID" changes to the ID of this unit, and the camera smoothly moves towards it:
public void Update()
{
if (Player[ID] != null && (battleTap == true || supportTap == true))
{
CameraTracking();
}
}
public void CameraTracking()
{
cam.Camera.transform.position = Vector3.SmoothDamp(cam.Camera.transform.position,
Player[ID].GetComponentInChildren<Camera>().transform.position,
ref cam.m_MoveVelocity, cam.m_DampTime);
}
private void Start()
{
_offset = transform.position - PlayerCamera.transform.position;
}
private void Update()
{
transform.position = PlayerCamera.transform.position + _offset;
}
Answer the question
In order to leave comments, you need to log in
Found the answer myself, it's all about Update:
"Often LateUpdate is used for a 3rd person stalking camera. If you move and rotate a character in Update, you can do all the camera movement and rotation calculations in LateUpdate. This will ensure that the character moves up to how the camera will track his position."
Decision:
public void LateUpdate()
{
if (Player[ID] != null && (battleTap == true || supportTap == true))
{
CameraTracking();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question