0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

回転に対してのコード

Posted at

local test = vci.assets.GetTransform("Empty2")
local a = 0
local SubItem = vci.assets.GetTransform("アイテムの名前")
local angle = 1

function updeteAll()
a = 0 + 1
if a > 360 then
a = 0
end
test.SetLocalRotation(Quaternion.euler(0,a,0))

angle = angle + 1
SubItem.SetLocalRotation(Quaternion.Euler(-90,0,0) * Quaternion.Euler(0,0,angle))

end

SubItem.SetLocalRotation(Quaternion.Euler(-90,0,0) * Quaternion.Euler(0,0,angle))
ここに関しては、回転速度と軸の固定するところになります。
そして複雑に回したいなら、(Quaternion.Euler(-90,0,0)ここを()の数字の中を変えるだけです。
失敗したくないなら最初は、C♯で作って動きを確認してからLuaに組み込むといいかと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?