How to create a hitbox in Roblox with Spatial Query and OverlapParams

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 61

  • @Shinssei
    @Shinssei 7 місяців тому +7

    this has gotta be top 1 best tutorials I've ever seen tysm bro

    • @Knineteen19
      @Knineteen19  7 місяців тому +2

      I'm glad I could help!

  • @DuoZ412
    @DuoZ412 3 години тому

    This is the best explaination I've ever seen! ty so much

  • @natetothefullerr
    @natetothefullerr 7 місяців тому +1

    this was actually a really good and informational guide that answer pretty much every single question i had. thanks!

  • @thereddye
    @thereddye 18 днів тому

    Thank you! Even if youre not a beginner this is a really good refresher for these functions

  • @kevengagner8362
    @kevengagner8362 11 місяців тому +3

    this is the best hitbox tutorial video I have came across and I have watched quite a few thank you for your time.

    • @Knineteen19
      @Knineteen19  11 місяців тому

      Glad I could help!

    • @aux2970
      @aux2970 11 місяців тому

      @@Knineteen19 Why does it hurt me as well? Should I separate it by using a module script?

    • @gamerplayer2174
      @gamerplayer2174 9 місяців тому

      @@aux2970 Before the humanoid takes damage just make a line of code where it checks so that if the characterlist is your name then it returns

  • @coolguy-lx3fy
    @coolguy-lx3fy Рік тому +6

    perfect tutorial everything is clear and every thing that is need is said perfectly nice one mate

  • @xyent9497
    @xyent9497 8 місяців тому +1

    thank you bro! was able to complete my fighting game because of you!

  • @spudphoenix9916
    @spudphoenix9916 6 місяців тому

    I thought this wouldn't be as good as other hit boxes but this video surprised me. Great work!

  • @randall8739
    @randall8739 Рік тому +1

    Good video, that makes things easier for creating hitboxes.

  • @bobsmart9420
    @bobsmart9420 Рік тому +1

    Best tutorial on hitboxes, you helped me so much. Keep it up, great work Man :D.

  • @Majed__Pro
    @Majed__Pro Рік тому +5

    Best scripter so far

    • @scrptr_rs
      @scrptr_rs 6 місяців тому

      Have you seen PopartNoahh

  • @hehe3534
    @hehe3534 4 місяці тому +2

    I've been using touched my whole life what kind of sorcery is this

  • @kingnoob7450
    @kingnoob7450 Рік тому

    amazing tutorial, tysm

  • @roboket3524
    @roboket3524 6 місяців тому

    thank you good video. i will just have to watch it 4 times at 0.25 x speed which is not the end of the world

  • @Tettzz
    @Tettzz 2 місяці тому

    Wow never knew about this. I always just used Touched but that always seemed to be slow and not accurate at all.

  • @onoca3861
    @onoca3861 9 місяців тому

    Very useful for making a button simulator, as the player stands on a button forever.

    • @RaS-r8q
      @RaS-r8q 8 місяців тому

      who tf would play that

    • @onoca3861
      @onoca3861 8 місяців тому +1

      @@RaS-r8q Thousands of people every day 🤯

  • @thousandthreads3842
    @thousandthreads3842 17 днів тому

    Hey loved your video very informative. I have a question tho so say i wanna detect certain body parts if the hitbox touches the right arm it sets it on fire the problem that i am having is even if it touches the left arm it still sets the right arm on fire. How do i get around this i'm fairly new to scripting.

  • @WAZERRUSSIN
    @WAZERRUSSIN 2 місяці тому

    Thanks

  • @xreverse_f1ash
    @xreverse_f1ash 5 місяців тому

    seeing this man start typing out task.wait() and then replace it with wait() made me freak out

  • @jacob1379
    @jacob1379 3 місяці тому

    how would i filter it to only detect a humanoidrootpart

  • @AshwinIslam
    @AshwinIslam 10 місяців тому

    I like this video.

  • @RaS-r8q
    @RaS-r8q 8 місяців тому

    bro how come your table prints out whats actually i the table? mine prints out "table: 278374Bxdj and some random numbers and letters"

  • @Kirachorizo
    @Kirachorizo 11 місяців тому +1

    Nice tutorial! I just have one question, do I need to give any credits for using the script you made in the tutorial?

    • @Knineteen19
      @Knineteen19  10 місяців тому +1

      Nah, you're good either way.

    • @Kirachorizo
      @Kirachorizo 10 місяців тому +1

      thank you! just in case I just wanted to tell you that I was referring to this tutorial (all the scripts from it) not the one for members.@@Knineteen19

    • @Knineteen19
      @Knineteen19  10 місяців тому +1

      Alright, yeah, thanks for making sure.@@Kirachorizo

    • @Kirachorizo
      @Kirachorizo 10 місяців тому

      Thanks, that means that I don't need to give you credits, right? I'm sorry if it's a bit annoying to ask you I'm a bit confused because I didn't really understand one thing and I don't want to get into trouble. Also thanks for all the responses!@@Knineteen19

    • @Knineteen19
      @Knineteen19  10 місяців тому +1

      Yeah you don't need to.@@Kirachorizo

  • @MarzFromMars
    @MarzFromMars 5 місяців тому

    question: is this possible without a physical hotbox? like lets say i have a table of positions and i want to get the positions in a certain range.

  • @Haze12492
    @Haze12492 7 місяців тому

    How do you make it not show the table with numbers and letters?

  • @WariosWare
    @WariosWare Рік тому +1

    How do i make it detect if only a part (no characters) touches it?

    • @Knineteen19
      @Knineteen19  Рік тому

      Well that's how the functions work by default. :GetPartBoundsInBox(), :GetPartBoundsInRadius(), and :GetPartsInPart() all return a table of the parts that collide with whatever given shape or part based on which function you use. If you want to check if a SPECIFIC part is being touched, then just run table.find(thePartTable, thePart) and see if it returns anything other than nil. "thePartTable" in this case is just the result of whichever function you're calling.

  • @Bloxtrem
    @Bloxtrem Рік тому +1

    Do you know how you can make a hitbox for your projectile? I'm not able to find a hitbox/AOE tutorial for Projectiles.

    • @Knineteen19
      @Knineteen19  Рік тому

      Hmm well there's a few ways you could do it. It kind of depends on the projectile itself honestly, but if the projectile is fairly small and moves fast enough that using something like spatial query (on a loop) would miss some collisions, then you could look into how this open-source module does things: devforum.roblox.com/t/raycast-hitbox-401-for-all-your-melee-needs/374482
      I have a system of my own that's inspired from the same method that I use for hit detection for small, moving things, since it works a lot better and is much less likely to miss collisions for something moving relatively fast.

  • @rileybelleville
    @rileybelleville Рік тому +1

    Ayee

  • @spgamerthing
    @spgamerthing Рік тому +1

    quick question, what does “CanQuery” do?

    • @Knineteen19
      @Knineteen19  Рік тому

      Here's the documentation answer: create.roblox.com/docs/reference/engine/classes/BasePart#CanQuery
      It's basically like the cancollide or cantouch but for raycasts and the overlap functions that this video covers. If you turn off cancollide, canquery, cantouch, and turn on anchored, then you basically completely remove all physics from an object, which can be useful for reducing the lag of special effects that you don't want interfering with raycasts and whatnot anyway.

    • @spgamerthing
      @spgamerthing Рік тому

      thanks bro!@@Knineteen19

  • @Scamingo
    @Scamingo 10 місяців тому

    Just a question, how would you have multiple parts of the same name excluded using FilterDescendants Instances

    • @Knineteen19
      @Knineteen19  10 місяців тому

      Are all of the parts inside the same parent and/or ancestor? If so, you could potentially create an empty table, loop through GetChildren() or GetDescendants(), and then add items to the empty table using table.insert() if they have a certain name. Then afterwards, you could set the params.FilterDescendantsInstances property to that table.
      Also sorry for the late response.

    • @Scamingo
      @Scamingo 10 місяців тому

      True, I figured it out anyways using if statements@@Knineteen19

  • @Sean_Does_Everything
    @Sean_Does_Everything 8 місяців тому

    W vid

  • @kingnoob7450
    @kingnoob7450 Рік тому +1

    btw i have a question, why did you multiply the part's size by 2?

    • @Knineteen19
      @Knineteen19  Рік тому

      At what part? Do you mind posting a time stamp?

    • @kingnoob7450
      @kingnoob7450 Рік тому

      @@Knineteen19 3:33

    • @Knineteen19
      @Knineteen19  Рік тому

      Ahh okay, so that's because in that part we've defined the "radius", which is half of the "diameter" of a sphere. The size property, however, is more like changing the "diameter" as opposed to the "radius", so we multiply the radius by two. Multiplying the whole Vector3 by 2 is just a shortcut for multiplying each individual value.@@kingnoob7450

    • @kingnoob7450
      @kingnoob7450 Рік тому

      @@Knineteen19 oh okay, thank you!

  • @BishopGoCrazy
    @BishopGoCrazy Рік тому

    could you post the script?

    • @Knineteen19
      @Knineteen19  Рік тому

      You can gain access to the studio files for $2.99/month by purchasing the lowest membership option.