0
我想让摄像机跟随播放器。为此,我使用播放器(在目标中)转换并更改相机的转换。继摄像机Unity
public class CameraScript : MonoBehaviour
{
public Transform target;
private Vector3 delta;
void Start()
{
delta = Camera.main.transform.position - target.position;
}
void Update()
{
Camera.main.transform.position = target.position + delta;
}
}
此方法的工作原理,但它是一个更好的解决方案?
可以说**基于意见的**。什么是更好的”_?你见过标准的Unity3D _smooth相机follow_ scripts吗? – MickyD
我的意思是使用任何像AddForce和速度为Rigidbody2D。 我不确定这种方法不会重新调用计算物理。 –
为什么要将一个刚体添加到_camera_?考虑[编辑](http://stackoverflow.com/posts/32791570/edit)你的问题,包括你的_intent_ – MickyD