1 Mart 2024 Cuma

A Sword Collider Problem & I solved it, it's fixed, thanks God :) & And the character can get hit :)

 The sword collider works when it is in the enemy's line of sight and the enemy's health decreases, but it also loses health when it is far away. When you activate the collision ignore option from the field of view and assign the sword collider there, its health does not decrease even when you attack it with a sword while it is next to it... Its health should only decrease in contact, that is, in a fight... Does anyone know what I should do?



Aslında bunun çok basit bir kodsuz çözümü var ancak çok da sağlıklı değil... Mesela görüş kutusunu epey daraltırsak sorun çözülür... Ama düşman bizi o zaman uzaktan görüp de yanımıza gelemez ya da bıçak fırlatamaz... :) Yani biraz daraltalım kılıçla vurunca da gerçekçilik pek bozulmasın... En iyi çözüm unity forumlarından yardım gelene kadar şimdilik bu gibi.. :)

Arkadaşlar sorunu biraz daha inceledim ve çözdüm bir Box Collider 2D daha tanımladım ve triggerını da aktif ettim... Böylece sadece yanındayken kılıçla saldırınca canı gidiyor... :)
Tek Colliderdayken triggerı aktif etseydik zeminden düşecekti.. :)

Friends, I examined the problem a little more and it was solved, I defined another Box Collider 2D and activated its trigger...

Bu da çözülmüş son hali:

But now my character does not get hit... Let's deal with it... :)


And the character can get hit :) This problem is also fixed... Thanks God... :)

Hiç yorum yok:

Yorum Gönder

4 Ekim 2024

 Merhaba arkadaşlar, Bu sabah da 10.10'da kargocunun aramasıyla uyandık... :) Kitaplarımızı getirmiş yalnız biri eksik belki sonra gönde...