c# - 在Unity C#中围绕中心点旋转

标签 c# unity3d

我想在 z 轴(上下颠倒)上旋转我的相机,但白色胶囊始终需要位于相机的中心(见图)。

enter image description here

提前致谢!

最佳答案

如果您不熟悉三角学,执行此操作的最简单方法是使用 LookAt 方法。 http://docs.unity3d.com/ScriptReference/Transform.LookAt.html

将相机的位置设置到您想要的位置,然后使用 LookAt 旋转相机的变换。

关于c# - 在Unity C#中围绕中心点旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33589220/

相关文章:

c# - 如何最好地处置因 AutoResetEvent.WaitOne() 而处于休眠状态的线程

c# - 微软应用中心 : How get list of users with session duration?

c# - 使用 asmdef 生成的程序集中的单一行为

unity3d - 如何运行本地 Unity WebGL(文件 ://url) build?

c# - unity2d : Character moves in different speeds on different phones. ..(Deltatime?)

c# - 我将如何每 5 到 7 秒实例化一个对象?

c# - 后台线程的 MSTest 失败

c# - 如何从计时器触发器获取 azure 函数运行位置的主机名?

c# - Xamarin forms 单击一次显示上下文菜单

c# - 在C#中执行mysqldatareader时为"The given key was not present in the dictionary"