Collision Detection in my Procedural Animation State Machine

Поділитися
Вставка
  • Опубліковано 10 лип 2024
  • Collision detection is crucial for my procedural animations, and in this video, I’ll show you exactly how I implemented it in my state machine.
    We'll cover creating a custom Environment Detection Collider which programmatically adjusts its size and position. And then use trigger events to detect and interact with objects in your game environment. We'll cover essential techniques to calculate the closest points on colliders and update inverse kinematics (IK) targets for realistic animations.
    Join me as we break down the steps to make your procedural animations more immersive and responsive. This tutorial builds on our previous episodes, so if you haven't seen those, be sure to check them out for a complete understanding of our state machine setup.
    SUPPORT THE CHANNEL AND GET EXCLUSIVE PERKS:
    💛 / iheartgamedev (Project Files Available)
    ❤️ ua-cam.com/users/iHeartGameDev...
    WANT MORE?
    Interested in learning more about animating characters in Unity? Check out my growing series of tutorials:
    ✅ • Programming For Produc...
    ✦ Like the vid? Please consider Subscribing!
    bit.ly/2YdIb6j
    ✦ Missed out on the last episode?
    • How to Move Characters...
    SOCIAL:
    ✦ Discord
    / discord
    ✦ Twitter
    / iheartgamedev
    ►TIMESTAMPS:
    Intro: 0:00
    Collider for Detecting The Environment: 0:25
    How does the Detection Work: 3:45
    Get Closest Point On Collider: 4:35
    Environment Interaction Shared Methods: 5:57
    Animating the Correct Side: 7:20
    Testing SetCurrentSide: 10:33
    Being selective with Layers: 11:15
    Testing Interactable Layers: 12:54
    IK Target Placement: 13:20
    Weights: 18:00
    #unity3d #designpatterns #gamedev

КОМЕНТАРІ • 30

  • @iHeartGameDev
    @iHeartGameDev  Місяць тому +15

    Over a year into it and the procedural animation series continues! I know it has been a long wait for this next entry, but I hope it was worth the wait! I should have a new video (unrelated to the procedural animation series) soon that I'm very excited about!

  • @kremuwczan
    @kremuwczan Місяць тому +3

    In order to isTrigger in box collider to work, either the player or the object that is triggering has to have rigid body attached to it right? from my testing it seems to be the case, so if someone is having issue that his box collider is not working make sure that either the player (if not using character controller) or the object has rigid body

  • @slsno3333
    @slsno3333 Місяць тому +1

    TBH have watched most videos 2x (some parts many times just to keep track between classes and scripts, where to put what.
    No idea where to begin, integrating a decent non rigbod character controller.
    Just that first moment once the left arm finaly did its own thing!
    Thank u so much for helping me learn.

    • @iHeartGameDev
      @iHeartGameDev  Місяць тому

      Hey I'm really happy to hear that you've been able to get through it! :) Thank you for following along and the support!

  • @AlexBlackfrost
    @AlexBlackfrost Місяць тому +1

    it's all coming together 👌

  • @ChristinaCreatesGames
    @ChristinaCreatesGames Місяць тому +1

    Very cool system 💛 Will have to take some time on the weekend to go through this, looking forward to it :D!

    • @iHeartGameDev
      @iHeartGameDev  Місяць тому

      Thank you Christina! :) Can't wait to get through these last few episodes

  • @Hoptronics
    @Hoptronics Місяць тому +3

    Can't wait.. :)

  • @rbjimmy7096
    @rbjimmy7096 Місяць тому

    Great video! I really like your presentation style, it helps me understand hard concepts in a way no other creator could. Do you ever plan on doing videos about saving/loading data?

  • @GameDev-re6rr
    @GameDev-re6rr Місяць тому +1

    Great explanation buddy. keep doing this good work and education new game devs

    • @iHeartGameDev
      @iHeartGameDev  Місяць тому

      Thank you for the kindness! More to come!!

  • @sugarsores6521
    @sugarsores6521 Місяць тому

    Damn good series fr

  • @sohjingkaisean3934
    @sohjingkaisean3934 Місяць тому +1

    Bro cook. This is crazy good

  • @framespaceproductions
    @framespaceproductions Місяць тому

    wow that's awesome , thanks buddy .
    can we do the same thin with doors , like how characters in rdr2 or gtav do ?

  • @SantaGamerYoutube
    @SantaGamerYoutube Місяць тому +2

    How about using non-allocating collision detection? I've pretty much replace all collision detection with those.

    • @iHeartGameDev
      @iHeartGameDev  Місяць тому

      Hi! What do you mean by that?

    • @SantaGamerYoutube
      @SantaGamerYoutube Місяць тому

      Using Physics.OverlapBoxNonAlloc, .OverlapSphereNonAlloc or .RaycastNonAlloc.
      It doesn't generate new arrays so it doesn't create new garbage.
      You'll then just need to create OnEnter and OnExit methods yourself if needed.

    • @hldfgjsjbd
      @hldfgjsjbd Місяць тому

      Thought about same thing

  • @dormitando
    @dormitando 4 дні тому

    Hey! You explain things really good and the editing is fantastic, but after finishing the playlist, there is some stuff, mostly components attached to the GameObjects, that must have been done outside the video and are never shown, for example:
    -Rigidbody
    -Capsule collider
    -Animator
    -PlayerStateMachine script
    Due to this my proyect is filled with compilation errors, could u give any hint on this, please?

  • @NOTAHEK
    @NOTAHEK Місяць тому +1

    I love your videos ❤ can you make a video on what DLL files does in unity 🥺.

    • @iHeartGameDev
      @iHeartGameDev  Місяць тому

      Hi! Thank you 🙏 What is DLL?

    • @NOTAHEK
      @NOTAHEK Місяць тому

      @@iHeartGameDev I am asking to you 😀

    • @NOTAHEK
      @NOTAHEK Місяць тому

      @@iHeartGameDev also you should have used physics.overlapping collider this will give you all the list of objects not just one 😊

  • @aritrachatterjee4257
    @aritrachatterjee4257 20 днів тому +1

    Anybody facing a problem where, the box collider is detecting only the player and nothing else?

  • @lawrence9713
    @lawrence9713 Місяць тому

    It is kind of off topic, but maybe someone knows a solution to it or can help me out. I want to create just the raw animation data in order to be able that every character in the scene could enter into this animation.
    For example, I have a spot on the map where a crime is happening, one npc is stabbing another npc. The two first npcs of many random npcs entering this area should take the spot of the criminal and the victim. So that every time you start the level these two npcs interacting with each other can always be different npcs.
    I was thinking of creating the animation in Blender, but not attaching fixed characters to it but Unity assigning them by whoever enters the trigger area first. Is that even possible? Isn't it like some kind of realtime cutscene, where your custom created character can show up in a pre made cutscene?