# 任意のz軸の方向でオブジェクトの傾きを求めたい

**URL:** <https://forums.unrealengine.com/t/z/661387>\
**Category:** 日本語 (Japanese)\
**Tags:** direction, unreal-engine, question, UE4-27\
**Created:** [October 3, 2022, 11:57am UTC](https://forums.unrealengine.com/t/z/661387 "2022-10-03T11:57:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![turbotanaka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@turbotanaka](https://forums.unrealengine.com/u/turbotanaka)\
**Post date:** [October 3, 2022, 11:57am UTC](https://forums.unrealengine.com/t/z/661387/1 "2022-10-03T11:57:14Z")

</div>

オブジェクトが水平から何度傾いているかを任意のZ軸から求めたいのですがどうすれば良いでしょうか。例えばXに50度、Yに30度傾いている物体が、Z軸で70度の所では水平からn度傾いている、といった具合です。

---

<div class="post-metadata">

**Author:** ![nyakagawan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nyakagawan/32/576107_2.png) [@nyakagawan](https://forums.unrealengine.com/u/nyakagawan)\
**Post date:** [October 3, 2022, 11:54pm UTC](https://forums.unrealengine.com/t/z/661387/2 "2022-10-03T23:54:50Z")

</div>

もっと直接的に値を求められるノードや関数があるかもしれませんが、例えばこのような感じでしょうか？

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/b/2cb67943efebf55dbf5e4f580062b04659259ff5.png)

---

<div class="post-metadata">

**Author:** ![turbotanaka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@turbotanaka](https://forums.unrealengine.com/u/turbotanaka)\
**Post date:** [October 4, 2022, 6:37am UTC](https://forums.unrealengine.com/t/z/661387/3 "2022-10-04T06:37:56Z")

</div>

上手くいきました！ありがとうございます。
