3 years ago

Hi everyone! I have one little problem.


I have 2 scripts: one for bullet and one for enemy. In EnemyController, there are function:

public void TakeDamage(int damage)

{

_health -= damage;

}

and I call it in script for bullet

if (hitInfo.collider.CompareTag("Enemy"))

{

hitInfo.collider.GetComponent<EnemyController>().TakeDamage(damage);

}

Unity says me, that it is error CS0103: The name 'damage' does not exist in the current context.

Why?



2 comments

Loading...

Next up

Как вам ендокий UI?

Ну и на последок улучшил немного графон

Ну, с Хэллоуином)

#UnderwaterDiving 1.0.9 BUILD 22

You are an underwater diver surrounded by aggressive fish and minefields

USP: Energy <=> Life + Stamina + Oxygen

Watch 30s of #Gameplay 20260211

Available on #Steam:

https://store.steampowered.com/app/2178190/Underwater_Diving/

Елки-палки! Надеюсь, я когда-нибудь это доделаю!

Animation Character - Action Simulate Walk Part02. GameAnim. #b3d, #blender, #unity, #game, #dead, #simulation, #key, #keyframe, #actiondead, #keyAnim, #character, #player, #rig, #armature, #rigify.

Вот это я понимаю, дробовик! Бабахнул и пол вселенной снесло! Вообще, в последнее время заглядываюсь на Wolfenstein, его оружие и позицию рук относительно камеры!

Заменил еще скай бокс

AAAAAAA! The spider is coming along!!! I'm actually quite proud of the way this turned out! I'm planning to take a break for a bit but I am ALSO gonna add some more idle movements to the spider and then apply some drop shadows and it'll look a ton better.

Дополнение на тюленьи когти, добавляющее альтернативную атаку: Мелкий выстрел, замедляющий противника на пару секунд