Space Shooter Game Development: Creating Bullets & Enemies (Part 2) | Godot 4 Tutorial

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 8

  • @dethnitegaming4178
    @dethnitegaming4178 3 месяца назад

    Hello! I was following the tutorial as normal, until I got an error with the "get.viewport()" function. Godot is telling me that it "cannot find property 'viewport' on base 'Callable,'". Is there a way to fix this, or some library I need to inport perhaps?

  • @itspaci
    @itspaci 11 месяцев назад

    When I shoot in the game, the bullets appear in the top left of the screen, and when they touch the left wall I get an error saying that take_damage is not defined.
    Any idea what could be causing this?

    • @dicode1q
      @dicode1q  11 месяцев назад +1

      Set collision layer and mask for the wall so that bullet don't collide with it. But if you want it to collide then, In the bullet script, before calling the take_damage function check if the body is enemy, then only call the take damage function

    • @itspaci
      @itspaci 11 месяцев назад

      @@dicode1q OK thanks! I'll try it out when I have time for it.

  • @puppetindustries1200
    @puppetindustries1200 Год назад

    How would I make the bullet follow the mouse?

    • @dicode1q
      @dicode1q  Год назад +1

      You need to calculate the vector from bullet position to mouse position.then use this direction to move the bullet. You can use look_at() function to rotate bullet images

    • @puppetindustries1200
      @puppetindustries1200 Год назад

      @@dicode1q thanks I’ll try it. Good video btw it helped me a lot