Ledge Detection Tutorial In Godot 4

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

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

  • @user-ry7fd6on9g
    @user-ry7fd6on9g 9 месяцев назад +42

    The fact this guy has light mode on is criminal

    • @Brokencircuitboard
      @Brokencircuitboard  9 месяцев назад +17

      Sorry if the light mode blinding your eye. I've got condition in which i cannot use dark mode for too long.

    • @Sp1cyP3pp3r
      @Sp1cyP3pp3r 8 месяцев назад +13

      ​@@Brokencircuitboarddude that's suck, hope you doin well. You did great tutorial 👍

    • @Brokencircuitboard
      @Brokencircuitboard  8 месяцев назад +10

      @@Sp1cyP3pp3r thank you

    • @TanukiDigital
      @TanukiDigital 6 месяцев назад

      I really started to prefer light mode after being forced to use it. I never switched back to dark after they made it optional. (' course I'm talkin' about Unity here)

  • @bossanova3494
    @bossanova3494 3 месяца назад +1

    Didn't realize it would be that easy! TYVM

  • @LiquidSpider
    @LiquidSpider 8 месяцев назад +3

    this answered a question i was dreading creating the answer for in the future
    many thanks

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

    This what I was looking for! Thanks for making tutorial about it. Also just a quick tip right click a node and find the "% Access as Unique Name" and click it, as this makes referencing nodes easier and useful because even when moving the node your reference to a different parent you wouldn't need to change the path for it. Almost forgot when this is toggled you have to use "%(Node's Name)" instead of "$(Node's Path)" or just drag and drop the node to the script.

  • @Singleraxis
    @Singleraxis 8 месяцев назад +2

    Very calm and educative video, thanks!

  • @Айдер_Нурмухаммедов

    you can combine all the tutorials into one Playlist

  • @yonefer
    @yonefer 10 месяцев назад +2

    thank you, very useful. :)

  • @snippyboons
    @snippyboons 25 дней назад

    I'm not super sure how this works, because the vertical raycast will always collide with the wall right after it fires from the first raycast's position...

    • @Brokencircuitboard
      @Brokencircuitboard  25 дней назад

      True. But in this case, I make the raycast thicker so it will offset a little bit to touch the ledge. Or, you can just offset the Z position a bit forward.

  • @mysooi9092
    @mysooi9092 6 месяцев назад +1

    thank youuuu!!

  • @slamigail
    @slamigail 4 месяца назад

    please make a tutorial on how to do a ledge grab!

  • @apoorvpandey3D
    @apoorvpandey3D 10 месяцев назад +2

    Thank you!

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

    but how would this work if you are in an indoor environment?

  • @ravethn
    @ravethn 6 месяцев назад +1

    why are there spongebob characters randomly LOL

  • @franciscolopez-kw2xq
    @franciscolopez-kw2xq 10 месяцев назад +1

    creo que este es el inicio del tutorial de agarré de cornisas

  • @user-we1jk9ff5z
    @user-we1jk9ff5z 2 месяца назад

    it seems like it wont work properly if wall is not straight

    • @Brokencircuitboard
      @Brokencircuitboard  2 месяца назад

      For uneven surface, maybe you can use shapecast instead raycast for bigger coverage.

  • @Snakesse4567
    @Snakesse4567 6 месяцев назад +1

    when i input the same code im getting a error on the line for hitpoint2 = raycast_ledge.get_collision_point()

    • @Brokencircuitboard
      @Brokencircuitboard  6 месяцев назад +1

      Did you declare the hitpoint2 variable? try adding var in front of hitpoint2.

    • @Snakesse4567
      @Snakesse4567 6 месяцев назад +1

      @Brokencircuitboard I did, that fixes the error, but the the actual function does not work

    • @Brokencircuitboard
      @Brokencircuitboard  6 месяцев назад +1

      @@Snakesse4567 it could be because your raycast not hitting the edge of ledge. Either make your raycast thicker or edit the offset.

  • @risajadewasurendre8298
    @risajadewasurendre8298 6 месяцев назад

    I think I found a gem

  • @bezoika4594
    @bezoika4594 9 месяцев назад

    This is great, can you show how to connect to and climb a ledge as well?

    • @Brokencircuitboard
      @Brokencircuitboard  9 месяцев назад +1

      Maybe at the next video. You can use either lerp or tween to move the player to ledge.

    • @bezoika4594
      @bezoika4594 9 месяцев назад

      @@Brokencircuitboard thanks, I'll look into that in the mean time, see if I can figure it out.

    • @noahchase7854
      @noahchase7854 9 месяцев назад

      @@bezoika4594
      var tween = create_tween()
      tween.tween_property(self, "position", platform.global_transform.origin, 1, ).set_trans(Tween.TRANS_LINEAR).set_ease(Tween.EASE_IN_OUT)
      Tweens self position to a variable called platform in 1 second

    • @atheneite
      @atheneite 9 месяцев назад

      @@Brokencircuitboard does it still snap the right way if it comes at a high angle? that's the part i'm having a hard time figuring out

    • @Brokencircuitboard
      @Brokencircuitboard  9 месяцев назад

      @@atheneite what do you mean?

  • @semaph0re
    @semaph0re 8 месяцев назад

    your offset Y is a static value of 0,3,0 so it only works for this specific height only?

    • @Brokencircuitboard
      @Brokencircuitboard  8 месяцев назад

      No. That Y offset is for the origin of second raycast, not the ledgepoint. You can get any height you want from that second raycast hitpoint as long as it within that Y value offset.

    • @semaph0re
      @semaph0re 8 месяцев назад

      @@Brokencircuitboard I don't understand how this second ray hits anything, it is on the *side* of a box, and it hits nothing because .. its on the side. Or is this raycast *inside* the box and it hits the upper most side of the box?
      In the video you are visualizing it as if the ray is on the outside, that's why I'm confused.

    • @Brokencircuitboard
      @Brokencircuitboard  8 месяцев назад

      1) 1st raycast hit the box forward. We got 1st hitpoint.
      2) We offset Y value of 1st hitpoint. now, we got origin of 2nd raycast position. This is the confusing part.
      3) Only then we create 2nd raycast. the position of the 2nd raycast is AT Y offset we make previously.
      4) We point 2nd raycast downward, whatever that raycast hit, we got our ledge point.
      and yes, 2nd raycast is outside of the player. I created empty node to hold the 1st raycast hitpoint.

    • @semaph0re
      @semaph0re 8 месяцев назад

      @@Brokencircuitboard if you point the 2nd raycast downward, wouldn't that just hit the 1st point again? Why would it be stopped by the box? It is on the same x,z position as the 1st point, which is stopped by the box. Don't you need a small offset at x or z to account for that?

    • @Brokencircuitboard
      @Brokencircuitboard  8 месяцев назад

      @@semaph0re Ah, i see what you mean. by right it shouldn't hit, but since you can set the raycast thickness in godot, it will barely hit. Or, just offset Z value. I don't bother doing that in this video, since it work for me 😅

  • @MrMr-oj7hl
    @MrMr-oj7hl 3 месяца назад

    this robot voice puts me to sleep make it faster

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

      I know right? Set playback speed to 1.25x sound better.