【问题标题】:How can I rotate object from the other object's up vector in Unity? [duplicate]如何在 Unity 中从另一个对象的向上向量旋转对象? [复制]
【发布时间】:2022-01-25 12:09:31
【问题描述】:

我想根据主对象的向上向量旋转子对象。 我认为这会起作用。

sub.rotation *= Quaternion.AngleAxis( 30.0f, main.transform.up );

但是,它没有用。 我该怎么做?

【问题讨论】:

  • 使用sub.rotation = Quaternion.AngleAxis(30.0f, main.transform.up) * sub.rotation;

标签: c# unity3d rotation


【解决方案1】:

sub.Rotate(main.transform.up, 30f);

【讨论】:

  • 我忘了提到我想为此使用刚体。我可以用 'subRigidbody.rotation' 做到这一点吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-24
  • 1970-01-01
相关资源
最近更新 更多