Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🚀 Unity FPS Dynamic FOV Settings

Unity Version License

TR: FPS oyunları için oyuncunun hareket hızına bağlı olarak dinamik Kamera Bakış Açısı (FOV) değiştiren, oyuna harika bir akıcılık ve hız hissi (game juice) katan hafif ve güvenli bir C# betiğidir.

EN: A lightweight and safe C# script for FPS games that dynamically changes the Camera Field of View (FOV) based on the player's movement velocity, adding a great sense of speed and fluid juice to the gameplay.


📺 Demo / Video

Watch the Video

Görsele tıklayarak YouTube üzerinden videoyu izleyebilirsiniz. / Click on the image to watch the video on YouTube.


✨ Özellikler / Features

  • Smart Hierarchy (Akıllı Hiyerarşi): Kamera, karakterin bir alt nesnesi (child) olduğunda üst nesnedeki (parent) Rigidbody bileşenini otomatik olarak bulur (GetComponentInParent).
  • Modern Unity Support: Unity 2023.1 ve sonrası için güncel Rigidbody.linearVelocity yapısını kullanır.
  • Crash Prevention (Güvenli Çalışma): Inspector'dan kamera veya Rigidbody atanmayı unutulsa bile null kontrolleri sayesinde oyunun çökmesini engeller.
  • Bilingual Comments: Kod içerisindeki tüm açıklamalar hem Türkçe hem İngilizce olarak dökümante edilmiştir.

🛠️ Nasıl Kullanılır? / How to Use?

TR (Türkçe)

  1. FOV_Settings.cs dosyasını projenize indirin.
  2. Bu betiği (script), karakterinizin alt nesnesi olan Kamera (Main Camera) objesine sürükleyip bırakın.
  3. Betiğin Inspector panelindeki Your Camera alanına kameranızı sürükleyin (Boş bırakırsanız otomatik bulmaya çalışacaktır).
  4. Karakterinizin hız limitine göre Speed Limit ve Fast FOV değerlerini dilediğiniz gibi optimize edin.

EN (English)

  1. Download the FOV_Settings.cs file into your project.
  2. Attach this script to your Main Camera object (which should be a child of your player object).
  3. Assign your camera to the Your Camera field in the Inspector (If left blank, it will try to find it automatically).
  4. Adjust the Speed Limit and Fast FOV values based on your player's movement configuration.

⚙️ Ayarlar / Settings

Değişken / Variable Varsayılan / Default Açıklama / Description
normalFOV 60f Karakter dururken veya yürürken varsayılan FOV. / Default FOV when idle or walking.
fastFOV 85f Karakter hız limitini geçtiğinde ulaşılacak FOV. / Target FOV when player exceeds the speed limit.
transformSpeedFOV 8f FOV geçişinin yumuşaklık hızı (Lerp). / Transition smoothness speed (Lerp).
speedLimit 10f Hızlı FOV'u tetikleyecek yatay hız eşiği. / Horizontal speed threshold to trigger fast FOV.

📄 Lisans / License

Bu proje MIT lisansı altında korunmaktadır. İstediğiniz gibi ticari veya kişisel projelerinizde kullanabilir, geliştirebilirsiniz. This project is licensed under the MIT License. Feel free to use and modify it in your commercial or personal projects.

About

Dynamic FOV script for Unity FPS games based on player velocity.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages