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

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

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

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

Trampolins

Also finally added some sound effects and the soundtrack. (You might hear it for the first time but it actually was in the first GameBoy Level in the devlog)

#GameDev #WA #GameBoy #Retro #Platformer #JumpNRun #VideoGame #GameDevelopment

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

#NinjaScroller 1.61.8 BUILD 49

With DOUBLE JUMP & QUICK FALL ATTACK!

A challenging Pixel Art #ActionRunner game with a Retrogaming vibe

Watch 30s of #Gameplay 20260208

Available on #Steam:

https://store.steampowered.com/app/2150800/Ninja_Scroller/

Вот, представляю вам: Тюленьи Когти!

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

#GrottoEscape PROTO 0.7.0 WIP

Follow and wishlist on #Steam:

https://store.steampowered.com/app/3433190/Grotto_Escape/

A DEMO will be available for the Steam Next Fest in February 2026.

Grotto Escape will be released in March 2026 on Steam.

Watch a WIP Gameplay 20260210

Ура! Канал ожил! https://t.me/GRRRRRROB Господа и дамы, прошу!