iT邦幫忙

2025 iThome 鐵人賽

DAY 22
0
自我挑戰組

從零開始學習Unity引擎系列 第 22

unity學習day22--製作遊戲(1)

  • 分享至 

  • xImage
  •  

今天開始正式製作遊戲

我在unity應用商店下載了五個可能用到的模組:

  1. Robot Kyle | URP(主角移動)
  2. Yughues Free Ground Materials(草地模型)
  3. URP Tree Models(樹的模型)
  4. AllSky Free - 10 Sky / Skybox Set(天空顏色)
  5. Starter Assets - ThirdPerson | Updates in new CharacterController package(鏡頭跟隨)

有了這些模組就不用從0開始寫遊戲了,unity存在的意義也正是這樣。

首先,在“視窗”的“渲染”找到“光照”,在光照裡面選擇“環境”,然後給“天空盒材質”隨意添加一個材質,這些材質就在剛剛下載的模組裡面。
https://ithelp.ithome.com.tw/upload/images/20250924/20178373ZrYr0iIF38.png

我選擇完之後的結果長這樣。
https://ithelp.ithome.com.tw/upload/images/20250924/20178373GXpNo5uzww.png

建立一個圓柱體,命名為“StartGround”,並且把“位置”設為(0,0,0),“縮放”設為(20,1,20)。
https://ithelp.ithome.com.tw/upload/images/20250924/20178373V1sOfmjKGR.png

然後建立一個材質叫“M_Grass”,點擊“底圖”左邊的小圈圈選擇草地的材質,這些材質同樣包含在模組裡面,然後把“正在平鋪”設為(4,4),把“平滑度”設為0.1,最後把材質拖到圓柱體上面,這樣一個出生點就做好了。
https://ithelp.ithome.com.tw/upload/images/20250924/201783738CNHbtqPCR.png

接著在專案的“Tree_Packs”找一棵樹,並把位置設為(0,1,0),縮放設為(4,4,4)。
https://ithelp.ithome.com.tw/upload/images/20250924/201783734P1La7yOcG.png

再然後在“StarterAssets”找到“PlayerArmature”,拖入“階層”中並改名為“Player”,再接著拖入“PlayerFollowCamera”和“MainCamera”,不過unity的MainCamera只能存在一個,所以必須把原來的MainCamera刪掉。
https://ithelp.ithome.com.tw/upload/images/20250924/201783731r2PdjBXze.png


上一篇
unity學習day21--模組的動畫
系列文
從零開始學習Unity引擎22
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言