LoginSignup
0
0

More than 1 year has passed since last update.

任意のオブジェクトをエモく回転&ふんわり上昇させる

Posted at

MVなんかでよくある、フワ…とオブジェクトが上昇してく演出を再現しました。
回転もさせられます。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RiseUpper : MonoBehaviour
{
    Vector3 startPos;
    public float x = 0.5f;
    public float y = 0.5f;
    public float z = 0.5f;
    public float speed = 0.005f; //上昇スピード

    void Update()
    {
        transform.Rotate(x,y,z);
        transform.position = new Vector3(0, startPos.y, 0);
        startPos.y += speed;
    }
}
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