top of page
搜尋

[Chaos Physics] Unreal Engine 5.2 駕駛Chaos車輛教學 |Driving Chaos Vehicle

  • 作家相片: Liling Liu
    Liling Liu
  • 2023年10月24日
  • 讀畢需時 3 分鐘

駕駛 Chaos 車輛


ree

匯入模型和貼圖: 將模型和貼圖匯入到引擎的Browser


ree

ree

這台車已經Rig了


FBX import Options:

Skeletal Mesh: turn on


Combine Meshes: If you have many separate mesh, you could turn on




















Plugins:


ChaosVehiclesPlugin



ree

WheeledVehiclePawn


ree

Create BP:


Right click mouse > Blueprint Class


All Classes:

search: vehicle

Select “ WheeledVehiclePawn ”



ree

Mesh > Skeletal Mesh Asset > car



ree

攝影機


Left side > +Add > SpringArm and Camera


Setup camera target Arm Length: 600


攝影機設定

Turn off:

Inherit Pitch

Inherit Yaw

Inherit Roll


攝影機碰撞:

Probe Size: 0

Do collsion test: Turn Off



ree

輪胎設定


選上 Vehicle Movement Component


這台車有四顆輪子,所以按四次 +


Wheel Setup > Wheel Setups > +


ree

Go to Skeleton and 拷貝骨頭名字


選骨頭 > 右鍵 > Copy selected Bone Names


ree

Paste to Wheel setups index bone name


ree

引擎扭力設定


Vehicle Movement component > Mechanical Setup

ree

2種方式可以創建 扭力曲線


ree

方法1: 點兩下扭力曲線視窗


ree

The graph's X 軸代表引擎 RPM (每分鐘轉數)

The graph's Y軸代表引擎扭力輸出 NM (Newton Meters)



Total Tougue : 300


Add curve points in 300


Shift + 滑鼠左鍵 : Add points


曲線如圖


ree

ree

方法2:



滑鼠右鍵 > Miscellaneous > Curve












ree


Pick Curve Class: CurveFloat






Add Keys


ree

Go to BP_Car


Vehicle Movement component > Mechanical Setup


External Curve > 選上剛剛所創建的curve



ree

Chaos Vehicle wheel Blueprint


在大多數情況下,每輛車至少需要兩種類型的車輪。.

  • 一個受轉向/引擎/手煞車影響的車輪,一個不受轉向/引擎/手煞車影響的車輪

  • 這可能是前輪或後輪尺寸不同的情況


Create wheel BP:

Blueprint Class > ChaosVehicleWheel



ree

Create front and rear wheel BP


ree


Double click BP_Front_Wheel


Setup

Wheel > Axle Type : Front

Affected by Handbrake: Turn Off

Affected by Engine: Turn on

Wheels setup

Max steer Angle:45

Affected by steering: Turn on


ree

Double click BP_Rear_Wheel


Setup

Wheel > Axle Type : Front

Affected by Handbrake: Turn on

Affected by Engine: Turn on



ree

Go back to BP_Car


更新wheel setups class


ree

Turn on Simulate Physics


ree

Game Mode


ree

Default Pawn Class: BP_Car


ree

World Settings


Window > World Settings



ree

Game mode

GameMode Override: GM_Car


ree

執行結果


ree

車子物理


ree

選擇物理並刪除


因為預設的形狀,比較不會跟車子輪胎,車體等一樣


ree

選擇全部輪胎骨頭 > Primitive shape: Sphere >Add bodies


ree

選擇Root 骨頭> Primitive shape: Single convex Hull >Add bodies


ree

控制攝影機選轉


Open BP_Car


ree

使用滑鼠來旋轉攝影機


Mouse X Axis Value ---> Delta Rotation Z

Mouse Y Axis Value ---> Delta Rotate Y



ree

執行結果:

發現車子不是在地板上,是浮空的



ree

改變車輪範圍

Go to BP_FrontWheel and BP_RearWheel change “ wheel radius ”


Wheel Radius: 20



ree

Result:


ree

Vehicle Movement


ree

Input Action


Project settings


ree

Go to Engine - Input


ree

Action Mappings: HandBrake --> Spacebar


Axis Mappings:

Thottle --> W

Brake --> S

Steering --> A , D


ree

Go to BP_Car


Each InputAsix to connect


Vehicle Movement


ree

Animaton


保留我們想要的車輛行為


Select car skeleton > right click mouse > Create > Anim Blueprint

ree

Opne AnimBP > Class Settings > class options > Parent Class : Vehicle Animation Instance


ree

Mesh Space Ref Pose: 這用於返回動畫藍圖中骨架網格物件的網格空間參考姿勢


Wheel Controller : 為了減輕創建這些類型動畫的大量工作,您可以使用滾輪控制器節點來驅動動畫。

ree

GO to BP_Car


Select Mesh > Animation > Anim Class : AB_Car


ree

Play game


Result


ree




Youtube Tutorial:








教學專案和文件下載 / Full Project and Document Download:





Sketchfab - Car Scene:



How to Set up Vehicles Unreal Engine 5.0




贊助 / Support Me




 
 
 

留言


CONTACT

Liling Liu

Email: liling5731@gmail.com

© 2016 - 2025 by LilingLiu. All rights preserved.

bottom of page