【Defold】動いているオブジェクトに向かってぴったり移動させる

2020/07/12Defold, DEVELOP

親子関係を設定した状態で移動させてあげると良いです。

-- 動いているターゲット
local target_id = go.get_id("id")
-- 親子関係にする
go.set_parent(go.get_id(), target_id, true)
-- 移動
go.animate(".", "position.y", go.PLAYBACK_ONCE_FORWARD, 0, go.EASING_OUTQUAD, 0.5)

目次

結果

お知らせ

Posted by kazupon