0 votes

In a shooting game, suppose the enemy is throwing some sort of fireball to the player, with a speed the player can manage to get rid off. What's the best way to check if player is hitten?
I have two options in mind:

  • a KinematicBody attached to the bullet, and use areas to check
  • collision a RayCast with vector magnitude increasing as bullet proceed
  • other?
Godot version 3.5
in Engine by (36 points)

1 Answer

+2 votes
Best answer

Since a bullets behavior is fairly simple (Just moves forward with a certain velocity until it hits something, then spawn some particles and then die.) and since you want them moving at a low velocity, I would recommend just using an Area node.

Two know when it hits something you just the area_entered and body_entered signals to a method that spawns a particle system for the fire effects and the queue free the bullet.

Also it doesn't make much of a difference if you use a kinematic body instead.

by (2,017 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.