Me throughout the entire video: "I sure hope he covers returning the head to its original position." *Pablo does it "Yes! I sure hope he covers how to stop the head snapping." * Pabo does it "Yes!! I sure hope he covers how to fix the weird head rotati-" *he does it once again "Holy cow"
@CoKeHQ13 ай бұрын
Thank you so much, this works really well and is so versatile too! I wanted to avoid using humanoid lookat workflow because I wanted to use the same system for every type of creature in our game. and this is just the solution!
@michaeltyers7336 Жыл бұрын
I was experimenting with head/eye constraints years ago and found it unnervingly realistic to have the characters eyes switch between looking at your left and right eye occasionally when your camera is smack bang between the middle of your characters eyes.
@JCitey4 жыл бұрын
This is something I really want to implement later on in my own game so this is perfect! I would really love if you would do that tutorial how to setup the point of interest list updater since I am still somewhat inexperienced how to do those kinds of things.
@inkofthedragon2 жыл бұрын
Phenomenal tutorial! Please do not change the formatting. Very easy to follow, clear, concise, no jargon. These types of videos are hard to find, please do not change! Excellent! Did have a question though. I put 2 POI near each other and had my player walk between. The head first tracked one POI but then quickly flicked to the second. I'm thinking it's because I walked right at the edge of both POIs radius and the rig is getting confused which to target. Any way to smooth out the look if my player notices the second nearby POI? Thanks!
@PabloMakes2 жыл бұрын
Oops I did change the format a bit 😅 takes too long to edit! For stacking them I like making the current one stick unless you go 75% or so of the distance, number depends on your use case but that’s way if you walk between two, it will choose one and stick with it until you get further from it. That plus some keeping and it should transition nicely
@inkofthedragon2 жыл бұрын
@@PabloMakes thanks for getting back. My POIs are attached to enemy heads. Problem I have right now is after killing the enemy, my player keeps looking at their body on the ground. I don't want this. So far I've tried disabling the POI script on the dead enemy but that is not working. Any thoughts? Thanks again!
@PabloMakes2 жыл бұрын
Can’t check the code right now to remember how it loops through them, but should basically need to add a check for if the gameobjects of the POI are active and if not, then disregard those
@Asier00703 жыл бұрын
I fucking love you man.. I've been looking for this like a long long time and FINALLY! Thank you
@PabloMakes3 жыл бұрын
Glad you found it!
@nicolasportu2 жыл бұрын
Outstanding! You have to make a series of this :)
@inkofthedragon2 жыл бұрын
ok got this to work. How do I make the upper body turn (gentle weight) slightly towards where the head is looking?
@PabloMakes2 жыл бұрын
Similar to the head but affecting a spine bone, and you can set the weight of that rig to like .3 and then change the head one to .7, so together they turn all the way
@MenelikiGaming3 жыл бұрын
Not gonna lie, my first instinct when I saw you implement the eye aim logic would be to make it so that only 1 eye follows the object. Yep. I'm weird like that. lol
@PabloMakes3 жыл бұрын
Don’t let your cross-eyed dreams be dreams
@whiskers15603 жыл бұрын
Cool stuff, thanks a lot.
@user-yn6xr5fd9u3 жыл бұрын
thank you that video was extremely helpful
@raphaelguitarx593111 ай бұрын
Hi, coming from the future, could you please make an update about this? For some reason using System.Linq looks like it change in 2022.2.21 version and therefore the first statement List POIs; is marked as error: Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'PointOfInteres' could not be found (are you missing a using directive or an assembly reference? I tried to substitute the list with an Array yet still the Target.position is still needed to have the character work, somehow yes is working like this but the character never ends up looking at the target: using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.Animations.Rigging; public class HeadTracking : MonoBehaviour { [Header("Head Tracking Variables")] [SerializeField] private Transform Target; [SerializeField] private Rig HeadRig; [SerializeField] private float Radius = 5f; [SerializeField] private float RetargetSpeed = 5f; [SerializeField] private float MaxAngle = 80f; [SerializeField] GameObject[] EnemyPOIs; float RadiusSqr; //List POIs; //[SerializeField] List POIs = new List(); // Start is called before the first frame update void Start() { //Head tracking section //POIs = FindObjectOfType().ToList(); EnemyPOIs = GameObject.FindGameObjectsWithTag("Enemy"); RadiusSqr = Radius * Radius; } // Update is called once per frame void Update() { Transform tracking = null; foreach (GameObject enemy in EnemyPOIs) { Vector3 delta = enemy.transform.position - transform.position; if (delta.sqrMagnitude < Radius) { float angle = Vector3.Angle(transform.forward, delta); if (angle < MaxAngle) { tracking = enemy.transform; break; } } } float rigWeight = 0; Vector3 targetPOS = transform.position + (transform.forward * 2f); if (tracking != null) { targetPOS = tracking.position; rigWeight = 1; } if (RadiusSqr == 5) { Target.position = Vector3.Lerp(Target.position, targetPOS, Time.deltaTime * RetargetSpeed); HeadRig.weight = Mathf.Lerp(HeadRig.weight, rigWeight, Time.deltaTime * 2); } } }
@RedShedG3 жыл бұрын
When she 14:47, i felt that
@diogomiguel54772 жыл бұрын
Great tutorial, is it possible to get the original bone transform right before the ik?
@100redcrows Жыл бұрын
Increidble tutorial! absolutely awesome, just what I was looking for, definately subscribed! I have a problem however, when writing the HeadTracking script it will tell me that PointOfInterest doesn't exist! and when trying to assign the PointOfInterest script to my "target" object, it will also say that said script (which I just created, mind you) doesn't have adequate syntax. Any tips? Thank you!!
@100redcrows Жыл бұрын
Nvm, i was not using System.Linq! If this can help anybody, make sure you're not missing the 3rd line of code of the script. Cheers, and thanks again, Pablo!
@CupcakePunisher Жыл бұрын
@@100redcrows yeah thanks, jezus...
@danieljohnson11672 жыл бұрын
I've been having trouble with my Unity package manager where it won't load at all and times out. Is it possible to get the scripts for PointsOfInterest and Rig for the HeadRig?
@just_x_alex Жыл бұрын
Hello! I've run into some difficulties while implementing this. Can you help me?
@kristiyanaleksiev84032 жыл бұрын
What should I change on the camera look script so when you look too far on left or right the whole body turns too because it looks kinda awkward right now but a good tutorial tho thanks.
@PabloMakes2 жыл бұрын
That’s not really something you would do here, this system is just for looking around, what you are looking for is something to move your character, so should be implemented in your character controller
@Togueznake Жыл бұрын
Can yoy give the script please
@TheGamingWiccan3 жыл бұрын
how would I make my player character's camera and head bone follow the position of my mouse?
@PabloMakes3 жыл бұрын
I assume you mean in a situation where the camera is fixed? If so, you can convert mouse position into world with ScreenToWorldPoint. Move a POI to follow that position. Hope that helps
@TheGamingWiccan3 жыл бұрын
@@PabloMakes I was thinking more like a situation where the camera would be in first person rather than third...
@PabloMakes3 жыл бұрын
Sounds like what you need is an FPS character controller? You don’t generally have head bones in first person since you don’t have a head haha I don’t have a tutorial for FPS controller, but I think maybe there’s a brackeys one
@Mr.Epsilion3 жыл бұрын
How to rotate camera FPS with head bones , please 🥺 help
@PabloMakes3 жыл бұрын
Sorry not sure what you mean. You don’t generally have a head in an FPS unless multiplayer for others to see or for mirrors