Unreal Engine mobile game
Автор: Amar Trivedi
Загружено: 2025-10-28
Просмотров: 9
Step 1: Project and Folder Setup
Open Unreal Engine and create a new project.
In the Content Browser, create a new folder called “Core”.
Inside "Core", create the following Blueprints:
Character Blueprint (e.g., BP_Character)
Player Controller (e.g., BP_PlayerController)
GameMode Base (e.g., BP_GameMode)
Step 2: Configuring Blueprints
Open BP_PlayerController and assign it to your GameMode (BP_GameMode).
In BP_GameMode, set the Default Pawn Class to your BP_Character.
Compile each Blueprint (set it to always compile automatically).
Save your Level to the Core folder.
Step 3: World & Character Settings
In World Settings, override the GameMode and select your BP_GameMode from the Core folder.
Adjust your BP_Character:
Change the capsule component’s radius and height as needed.
Assign a Mesh to the character (choose an imported or default skeletal mesh).
Set the Animation Blueprint to an existing one (e.g., ABP_Bot) for idle/movement states.
Adjust the character’s mesh so it is properly aligned in the capsule.
Step 4: Mobile Movement with Joystick
In BP_Character, select the Character Movement component:
Enable “Orient Rotation to Movement”.
In BP_Character’s main Blueprint settings, turn OFF “Pawn Uses Controller Rotation Yaw” to prevent camera conflicts.
Setup the Event Graph:
On “Event Possessed”, cast to your BP_PlayerController.
From the controller, access the Enhanced Input Local Player Subsystem.
Add your input mapping context for mobile (usually called IMC_ThirdPersonControls).
On your input actions, create nodes for “Enhanced Input Action Move”.
Split the Action Value output into X and Y values.
Connect X and Y to “Add Movement Input” (X for right/left, Y for forward/back).
Use “Get Control Rotation”, split it, and connect right & forward vectors properly to control movement direction based on joystick position.
Step 5: Third-Person Camera Setup
Add a Spring Arm to your BP_Character and make it the root of your camera:
Set Target Arm Length and disable Collision Test.
Add a Camera as a child of the Spring Arm.
Reset camera rotation to (0,0,0) for a neutral view.
Optional: Adjust the spring arm’s rotation to set camera angle (e.g., -80° Pitch).
Step 6: Mobile UI & Joystick Controls
Go to Project Settings → Maps & Modes:
Set the default GameMode to your BP_GameMode.
Set the Editor Startup Map to your main mobile level.
Search "Touch" in the Project Settings and:
Enable single-finger controls (“Always Show Touch Interface” or equivalent).
Ensure settings for joystick/touch input are ON (these enable mobile controls).
Customize the Touch Interface:
Create/copy a touch joystick from Unreal’s templates.
Assign this new joystick as the Default Touch Interface in Project Settings.
For a single joystick (no dual sticks), remove unnecessary elements and copy only what's needed.
Turn on “Prevent Recenter” for smoother thumbstick motion.
Step 7: Testing & Preview
Go to Editor Preferences:
Set “Play” settings to “New Editor Window (PIE)” for pop-out preview.
Use Mobile Preview (PIE) to see how your game will look on devices.
Add a Player Start actor to your level.
Adjust spring arm or camera as needed for better view.
Play in the editor and test all joystick/mobile controls.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: