畢專第四組
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `Unity Camera` [toc] # Cinemachine Cinemachine可以使用在運鏡上還有camera輕鬆切換,配合timeline可以輕易控制所有物件出現的時間以及動畫轉變。 # 安裝 Cinemachine 現在可以在 Package Manager 裡面下載。 下載好cinemachine套件後視窗上方會多一個選項 ![](https://i.imgur.com/AlapDaj.png) ![](https://i.imgur.com/kHKMBhn.png) **上方的cinemachine需要先完成安裝才會顯示。** ![](https://i.imgur.com/CXNLpeW.png) # ------------------------------------------- # 建立 virtual camera ![](https://i.imgur.com/CXNLpeW.png) 預設MainCamera會自動在Inspector新建一個CinemachineBrain物件,**一定要有cinemachineBrain物件**。 > 這個virtual camera是幹嘛用的呢?剛剛不是已經有創個camera brain了嗎。 可以想像成virtual camera是路上的監視器,而brain則是監控室中的螢幕,可以隨時切換成某一支監視器的觀看畫面! > > [name=blueremedy] [參考資料:[Day9] 攝影機設定](https://ithelp.ithome.com.tw/articles/10236268) ![](https://i.imgur.com/Na7nVWG.png) 如果沒有出現的話,也可自行新增 ![](https://i.imgur.com/j0L4gyp.png) - 在Hierarchy出現CM vcam1 即是我們剛建立的virtual camera ![](https://i.imgur.com/Uolbqcf.png) --- ## 新增一個空物件專門管理timeline ![](https://i.imgur.com/erFhapN.gif) - 在空物件新增timeline ![](https://i.imgur.com/7hwU8ck.gif) --- ## 調整virtual camera後加入timeline - 將timeline軸上(timelime管理空物件)沒用到的先刪掉 ![](https://i.imgur.com/6yXtUkk.gif) timeline這個工具就像由開發者寫的劇本,我們可以自由決定所有物件出場的時間,以及動畫何時播放?跟攝影機的切換以及先後順序。 - 在timeline先新增cinemachine Track,並把Main Camera(物件底下有cinemachineBrain)拉進去 ![](https://i.imgur.com/vtW5ed2.png) - 在timeline的時間軸上右鍵新增cinemachine Shot,並把CM vcam1拖到右方 ![](https://i.imgur.com/ZDl03wf.png) ![](https://i.imgur.com/IThnEHd.png) ![](https://i.imgur.com/d9UsZHg.gif) 這樣timeline上就有一個相機了! 不過只有一個相機的鏡頭並不夠看,所以我們可以用相同的方法在建立一個新的virtual camera,或是利用Dolly & track來製作類似攝影軌道的拍攝手法。 --- # 相機晃動 每個virtual camera底下有一個CinemachineVirtualCamera的component,這個元件下有一個Noise屬性 ![](https://i.imgur.com/GKYpHr6.png) 對Noise選擇Basuc Multi Channel ![](https://i.imgur.com/iCrK9Rr.png) 在Noise Profile有多種選擇可以選,一定要選才有效果 ![](https://i.imgur.com/cJdR0La.png) 這邊我選擇「Handheld_normal_extreme」,當然這些都要看開發者想做出什麼樣的效果來決定,「6D Shake」也是熱門選擇! 我個人認為它的特效很適合做遊戲中地震或是打擊晃動的效果。 ![](https://i.imgur.com/VUKttj5.png) - **Amplitude Gain:** 可以調整晃動的強度 - **Frequency Gain:** 可以調整晃動的頻率 ![](https://i.imgur.com/uTrX2Fq.png) 最後記得把相機加到timeline上面 --- # Follow 和 LookAt 的不同和應用 Follow是相機跟著我們選定的目標用移動的方式跟進,而LookAt是相機停滯在原地用旋轉的方式跟進。 - 我們用Body來移動camera,Aim來轉動camera。 ![](https://i.imgur.com/ZZIMVr8.png =50%x) 選擇Follow的話,我們的virtual camera主要是在Body進行調控。 Follow Offset是控制virtual camera的位置: x軸是左右,y軸是上下,z軸是遠近。 Damping是在控制鏡頭挪動時的順暢度(數字越大越順暢)。 ![](https://i.imgur.com/p3LO6AI.png =50%x) 選擇LookAt的話,我們的virtual camera主要是在Aim進行調控。 Offset和Damping的部分,和Follow相同。 - Dead Zone 是一個呈現在Game的小方框(理論上,是在畫面正中央的無色區塊),如果目標移動出了Dead Zone,鏡頭才會旋轉跟進。 換句話說,Dead Zone越小,鏡頭就必須越為頻繁地跟進,我們看到的畫面就會越流暢。 - Aim的流暢度需要注意兩個部分:Dead Zone劃出範圍,超出範圍就會造成鏡頭旋轉;Damping控制超出後的誤差,值越小,就會越為即時性地關注目標是否超出Dead Zone。 --- # 利用相同手法在做幾個virtual camera ## 小技巧 Statis:Live Solo 當有多個virtual camera在場景時,我們若想馬上查看其中一個camera的攝影範圍而不想透過執行遊戲查看,我們可以直接點solo,就可以直接查看該相機。 ![](https://i.imgur.com/L3DwnJW.png) ## 小技巧 Align With View 當新增一個virtual camera在場景時,我們若想先找好一個合適的角度(直接挪動鏡頭有點麻煩~),可以先用滑鼠右鍵和滾輪找到合適的位置,然後點選其中一個camera,選擇GameObject的Align With View,鏡頭就會自動切換成我們事先找到的合適位置。 ![](https://i.imgur.com/dPHzDpW.png =50%x) - 快捷鍵:找好位置,滑鼠留在Scene,然後按Ctrl+Shift+F --- # 依照上述相同的方式建立第二個virtual camera並放上timeline上 ![](https://i.imgur.com/vs5VORD.png) - 先來看看兩個相機分別拍攝哪先範圍 ![](https://i.imgur.com/rqW0Aqo.gif) - blend兩個相機後 ![](https://i.imgur.com/Zf5avia.gif) - blend後的結果 ![](https://i.imgur.com/5BX54kV.gif) --- # ------------------------------------------- # Dolly & Track 可以製作出拍攝軌道的效果 ![](https://i.imgur.com/DdkunCj.png) ## 建立Dolly & track ![](https://i.imgur.com/jtedRwM.png) 建立後會一次產生兩個物件 - virtual camera - DollyTrack ![](https://i.imgur.com/aIBjbLi.png) --- ## LookAt 、Follow virtual camera有兩個屬性可以讓攝影機跟隨物件或是看著該物件。這兩個屬性並非Dolly & Track才能使用,只要是virtual camera都可以使用。 - 將想拍的物件拉近LookAt欄位 ![](https://i.imgur.com/76dMtyF.png) 會看到game視窗呈現下方的效果 ![](https://i.imgur.com/vAtFUmJ.png) > 在virtual camera 中有個Aim欄位,能針對追蹤工能做細節微調。比較常用到的是Dead Zone Width 及 Dead Zone Height。調整後的結果會即時顯示在Game視窗中,各顏色範圍分別表示 > > **透明:** 自由區,主角在這範圍移動,攝影機不會跟隨。 > **藍色:** 軟跟隨區,主角移動到這個區域時攝影機移動,使主角保持在透明區。 > **紅色:** 死區,主角無法到這個區域,攝影機移動使主角強制保持在紅色區域外。 > > [name= blueremedy] > [資料參考來源:[Day9] 攝影機設定](ht tps://ithelp.ithome.com.tw/articles/10236268) ## 在DollyTrack新增軌道 - 在DollyTrack的WayPoints新增 ![](https://i.imgur.com/B2AURw0.png) - 新增軌道後會看到0,就是我們第一個軌道,且與我們的virtual camera距離很遠 ![](https://i.imgur.com/m7LLTmd.png) - 調整0軌道跟virtual camera的位置,讓0軌道在virtual camera的位子 - 繼續新增軌道 目前我新增了5個軌道,最後一個Path編號為4 ![](https://i.imgur.com/aCnNZdP.png) 在Scene的樣子 ![](https://i.imgur.com/mKafteh.png) ## 將軌道上的畫面錄成Animation - 首先在timeline上加上一個Animation Track,並將Dolly & track的virtual camera加上去 ![](https://i.imgur.com/RJlIfKn.png) ![](https://i.imgur.com/4N0MInJ.png) - 運用Amination Track來將我們的軌道錄起來,點選紅色按鈕錄影 ![](https://i.imgur.com/K0jhw40.png) ![](https://i.imgur.com/hLL8z88.gif) 接下來要特別留意自己建立了幾個軌道,像我就是建立了5個軌道,因此我在想要結束的時間軸上利用virtual camera 的CinemachineVirtualCamera元件下的Body屬性 : Path Position 來錄影。在想要的timeline時間軸上做變更,每次變更成功會發現時間軸上多了一個key。 在開始的地方新增一個 Path Position 為 0 的 key 在結束的地方新增一個 Path Position 為 4 的 key ![](https://i.imgur.com/wxsWSGO.png) 透過在下方圖片欄位的調製來讓錄影錄進去。 ![](https://i.imgur.com/UfND6Ms.png) - 先新增結尾的key,Path Position 為 4 ![](https://i.imgur.com/97I3uKB.gif) - 新增初始的key,Path Position 為 0,必須新增初始key軌道才能從0開始出發! ![](https://i.imgur.com/Bri6rU6.gif) - 最後最後 ! 把 Dolly & Track 的 virtual camera 拉到對應的動畫時間軸上 ![](https://i.imgur.com/xvRb0ng.gif) # 完成一個Dolly & Track了! 恭喜發大財! --- # ------------------------------------------------------- # 做出一個粗糙的小劇場 某個人想去某間小屋裡面,但突然發現後面有人跟蹤他!!所以他頭猛一轉 > 請大家不要抨擊我,窩也素剛學55555 > [name=朱妍穎] 前面提過timeline可以放任何的物件,於是我就加了點音效進去 {%youtube D4BgI9Z3lnU %} ---

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully