2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Unity のカメラにスクリプトをアタッチしていい感じの動画を作る

Last updated at Posted at 2021-04-03

現在作ってるゲームの予告編を作った時のことを、自分用の備忘録を兼ねて残します。

※動画に登場するキャラクターはユニティちゃんライセンス条項の元に提供されています。
© Unity Technologies Japan/UCL



つくった予告編

解説

この動画のなかで、
映画のクレーンを使ったような箇所があります。


Unityのカメラにカメラが移動するスクリプトをアタッチします。
MoveCamera1.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//上空から降りてくるカメラワーク
public class MoveCamera1: MonoBehaviour
{
    float y;
    void Start()
    {      
    }

    void Update()
    {
        Transform cameraTransform = this.transform;

        // 座標を取得
        Vector3 pos = cameraTransform.position;
        pos.y -= 0.01f;   
        cameraTransform.position = pos;  // 座標を設定
        Debug.Log("y:" + pos.y);    
       
    }
}



カメラが地面すれすれに移動する箇所も同様。

MaveCamera2.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//地面すれすれに移動するカメラワーク

public class MoveCamera2: MonoBehaviour
{
    float y;
    void Start()
    {      
    }

    void Update()
    {
        Transform cameraTransform = this.transform;
        // 座標を取得
        Vector3 pos = cameraTransform.position;
        pos.z -= 0.01f;
        cameraTransform.position = pos;  // 座標を設定
        }
    }
}




これらも同様です。


このように、ちょっとカメラを動かすだけで、なんかそれなりに、いい感じの映像が撮れますね。

あとは、これを動画キャプチャ(Windowsの場合:Windows + G)して、映像ファイルを作成します。





P.S.
本件とは関係ないですが、自分用の備忘録をかねて。

動画で使う文字は、Unityの文字ツールよりも、PowerPointで作ることが多いです。
透過画像ファイル、透過GIFアニメなど簡単に作れるからです。



2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?