ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

🔥 How to Make a Game Like Lost War ads - Part 28 || Fix Movement Trigger Bug & Bullet Spawner

Автор: Tasty Cherry Games

Загружено: 2025-12-02

Просмотров: 19

Описание: In this Unity game development tutorial, we fix a player movement trigger bug and then build a complete bullet shooting system from scratch. This video is part of our ongoing Unity series where we focus on writing clean, optimized, and scalable code for real games.

We begin by addressing a critical issue in the player movement logic. The problem occurred when the player entered +10 or -10 trigger zones, where movement was restricted to only one direction. After reviewing the code closely, we discovered that a condition checking clientStatus == 1 was completely unnecessary. This logic was mistakenly copied from an older script and caused the directional restriction bug. Once removed, the player can move freely in both directions without breaking the movement system.

After confirming that the fix works correctly and does not affect the player controller, we move on to implementing a bullet shooting system.

To keep the project clean and modular, we create two separate scripts:

Bullet Movement Script

Bullet Spawner Script

The Bullet Movement Script is responsible for moving the bullet forward from the gun’s tip. We use Unity’s Update() method to continuously move the bullet in the forward (Z) direction, ensuring it follows the player’s aiming direction. Bullet speed is controlled using a SerializeField variable, allowing us to tweak values directly from the Inspector without modifying code.

Instead of using heavy bullet models, we create a simple cube-based bullet. Since bullets travel at very high speeds, complex meshes are unnecessary and waste performance. To improve visibility, we add a basic material with emission, giving the bullet a laser-like appearance. This approach keeps performance high while still looking visually clean.

We also handle pivot and axis alignment issues, which are common when working with weapon models. By using empty GameObjects and aligning them correctly with the world axis, we ensure bullets spawn in the correct direction every time.

Once the bullet is ready, we convert it into a prefab, making it reusable throughout the project. We also assign a Bullet tag, which will later help with collision detection and damage logic.

Next, we create the Bullet Spawner Script. This script listens for player input (such as pressing the F key) and spawns the bullet prefab at the gun’s tip. This keeps firing logic separate from bullet behavior, making the system easier to expand later with features like fire rate control, ammo systems, or object pooling.

By the end of this video, you’ll have:

A fixed movement trigger system

A working bullet prefab

A clean bullet movement script

A functional bullet spawner

Proper prefab and transform setup

This tutorial is perfect for beginners and intermediate Unity developers working on:

FPS or TPS games

Shooting mechanics

Player movement bugs

Prefabs and transforms

Performance-friendly project setups

In future videos, we’ll expand this system with collision detection, damage handling, and object pooling for better performance.
🧠 Why This Approach?

Instead of using heavy bullet models, we use a simple cube with emission, which is:

Performance-friendly

Nearly invisible at high speed anyway

Ideal for fast-paced shooters

We also structure everything into separate scripts (movement & spawner) to keep the project scalable and clean.

This tutorial is perfect if you are:

Learning Unity FPS mechanics

Building a shooting system step by step

Fixing trigger-based movement bugs

Working with prefabs, transforms, and forward direction

Optimizing for performance in real-time games

📌 In the next video, we’ll continue by improving the bullet spawner, handling collisions, and expanding the shooting logic.

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
🔥 How to Make a Game Like Lost War ads - Part 28 ||  Fix Movement Trigger Bug & Bullet Spawner

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Я удалил ВЕСЬ ВЕБ в Windows 11. Что из этого вышло?

Я удалил ВЕСЬ ВЕБ в Windows 11. Что из этого вышло?

🔥 How to Make a Game Like Lost War  - Part 29 || Modular bullet firing system - BulletSpawner

🔥 How to Make a Game Like Lost War - Part 29 || Modular bullet firing system - BulletSpawner

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

How to make the Best Player Controller in Unity

How to make the Best Player Controller in Unity

ESP32 + MLX90640: тепловизор с искусственным интеллектом (TensorFlow Lite)

ESP32 + MLX90640: тепловизор с искусственным интеллектом (TensorFlow Lite)

Что будет если поместить портал в портал? Объяснение

Что будет если поместить портал в портал? Объяснение

ChatGPT против Grok Make Doom

ChatGPT против Grok Make Doom

Интернет в небе: Сергей

Интернет в небе: Сергей "Флеш" о том, как «Шахеды» и «Герберы» научились работать в одной связке

Новый DIY проект! Самодельная портативная приставка. Часть 1 - Система охлаждения.

Новый DIY проект! Самодельная портативная приставка. Часть 1 - Система охлаждения.

ОТКЛЮЧИЛ ЭТО в Play МАРКЕТ и ОФИГЕЛ!! Мой ANDROID ЛЕТАЕТ!!

ОТКЛЮЧИЛ ЭТО в Play МАРКЕТ и ОФИГЕЛ!! Мой ANDROID ЛЕТАЕТ!!

ChatGPT против Gemini: создайте Geometry Dash с нуля

ChatGPT против Gemini: создайте Geometry Dash с нуля

Сделал визуализацию 4D, 5D, 6D. Как выглядит 6D мир?

Сделал визуализацию 4D, 5D, 6D. Как выглядит 6D мир?

GameMaker Studio 2: Полное руководство по платформеру (Часть 1: Основы)

GameMaker Studio 2: Полное руководство по платформеру (Часть 1: Основы)

🔥 How to Make a Game Like Lost War  - Part 31 ||  bullet collision with enemies

🔥 How to Make a Game Like Lost War - Part 31 || bullet collision with enemies

CLI АГЕНТЫ - что это такое и почему я ОТКАЗАЛСЯ от ChatGPT?

CLI АГЕНТЫ - что это такое и почему я ОТКАЗАЛСЯ от ChatGPT?

ESP32: распознавание речи нейросетью (TensorFlow Lite)

ESP32: распознавание речи нейросетью (TensorFlow Lite)

Негативный портал - как он объясняет карманное пространство?

Негативный портал - как он объясняет карманное пространство?

How to make a Video Game - Godot Beginner Tutorial

How to make a Video Game - Godot Beginner Tutorial

Wildberries антибот: разбор защиты + парсер поисковой выдачи

Wildberries антибот: разбор защиты + парсер поисковой выдачи

Почему вам следует использовать сервер рендеринга Godot

Почему вам следует использовать сервер рендеринга Godot

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]