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

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

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

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

A New Screnshot From My Friend Klawf

We went upstairs and found an onix.

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

Here's a short video showing off the improved gameplay loop and "stage complete" screen. The updated artwork for Hensen and his gun and the honey bullets can also be seen.

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

Ну, тип один из скримеров для моей короткометражки для задания по режиссуре. Ну да

You wake up in a strange room...

Here's the starting room for my next game! I finally got to start dressing the first level. You'll have to open the door somehow.

Hope you like it!

#gamedev #unity #3d #horrorgame #horror #videogame #indiegame #ps1 #psx

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