Collision Detection in my Procedural Animation State Machine
Vložit
- čas přidán 1. 07. 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)
❤️ czcams.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
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!
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.
Hey I'm really happy to hear that you've been able to get through it! :) Thank you for following along and the support!
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
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?
Very cool system 💛 Will have to take some time on the weekend to go through this, looking forward to it :D!
Thank you Christina! :) Can't wait to get through these last few episodes
Can't wait.. :)
Thank you for your excitement!
it's all coming together 👌
"It's been 84 years" lol
Great explanation buddy. keep doing this good work and education new game devs
Thank you for the kindness! More to come!!
Damn good series fr
wow that's awesome , thanks buddy .
can we do the same thin with doors , like how characters in rdr2 or gtav do ?
Bro cook. This is crazy good
Thank you for the kind words!
Anybody facing a problem where, the box collider is detecting only the player and nothing else?
I love your videos ❤ can you make a video on what DLL files does in unity 🥺.
Hi! Thank you 🙏 What is DLL?
@@iHeartGameDev I am asking to you 😀
@@iHeartGameDev also you should have used physics.overlapping collider this will give you all the list of objects not just one 😊
How about using non-allocating collision detection? I've pretty much replace all collision detection with those.
Hi! What do you mean by that?
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.
Thought about same thing
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?