I’m trying to create a skill that involves projectiles. I heard that the best way would be using Raycasting, but then I realized that it would be necessary to create a hitbox to make it 100% functional. I researched a lot and didn’t find any tutorial or topic really teaching how to create a hitbox for raycast (in my case, a projectile). Could someone explain to me or tell me if there is an API that does this and that I could use for my goal? I already thank in advance anyone who can help me.
Character models are also able to be utilized as hitboxes.
The player’s Character that receives the projectile? In this case, would I need to use Touched, right?
The .Touched
events are to be described in two ways; way too accurate, or inaccurate.
It’s only suggested use is for one-time events like kill bricks, checkpoints and buttons. While yes, it is the easiest one to use, it lacks efficiency when it comes to acting as the hitbox, especially when you are implementing fast-moving projectiles.
I therefore suggest using :GetPartsInPart()
or :GetPartBoundsInBox()
dependent on what type of hitbox detection you plan to do. I suggest digging into those functions and learn how they work, since it’s common to face certain problems that require these functions in the future.
I use Touched, but only for very basic combat systems or skills.
I will research these functions and then return here, the skill I’m making is similar to a fireball and I just want to create a simple hitbox for raycasting so that when the skill touches any part of the enemy, they take damage.
Anyways, thank you for answering my question.
Thank you very much, the function :GetPartBoundsInBox() solved my problem, I just needed to use overlap instead of Raycast. I believe that the :Raycast() function is similar.
But anyway, thank you very much!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.