#Hello guys

1 messages ยท Page 1 of 1 (latest)

golden zenith
#

Let's talk in the thread guys!

grand venture
golden zenith
grand venture
golden zenith
grand venture
golden zenith
#
private Vector3 leftAdjust = new(0, 80, -10);
        private Vector3 rightAdjust = new(0, 98, 2);
        protected void _Eyes()
        {
            leftEye.transform.LookAt(this.transform);
            leftEye.transform.Rotate(leftAdjust);
            rightEye.transform.LookAt(this.transform);
            rightEye.transform.Rotate(rightAdjust);

            //Quaternion q = Quaternion.LookRotation(this.transform.position - leftEye.transform.position, Vector3.forward + Vector3.right);
            //leftEye.transform.rotation = q;
        }
#

this.transform is the camera

#

Now, I'll take screenshots with what you suggested

#

now I simply adjust camera, pause the game, and take screenshots

#

camera is above the head

#

camera is below the head

#

but if I move down to the right

#

I hope you got what I meant when I said "rotates only in one axis"

grand venture
golden zenith
#

but I think it's fixable, I just need to put a boundary so that eyes don't turn further from it

grand venture
#

If you make an anchor object and matches eyeball to look Z axis
Then you can rotate parent object with LookAt

#

Or maybe your eyeball is too big

#

So it's center is not actually eye's center

golden zenith
#

I didn't try that one yet, let me take a look at it

Sounds like a genius idea, I hope it'll work out the same way it did in my imagination ๐Ÿ˜„

grand venture
#

Hopefully

golden zenith
#

@grand venture
Hey man, I put it inside an empty gameobject, now it looks okay, maybe slightly better than my first screenshots

#

now, could you please suggest me anything related to limiting the eye movement?
I was thinking about an if statement that checks for the camera position, if it exits some boundaries, it'll simply not turn eyes towards it.
However the problem arises when you put camera closer to the model, then those boundaries are no longer valid.

Would be glad to receive any ideas

grand venture
golden zenith
#

Thanks man, really appreciate that,
Bought you a coffee ๐Ÿ™‚ Let me know if you received everything

grand venture
#

Let me know if you have more issue

golden zenith
#

@grand venture Good morning (I hope it's morning in your time zone)
I implemented eye movement, it works almost exactly as intended, but a little thing I miss is the smoothness

I limited the eyeball rotation so that eyes look a little more natural when the camera moves on the sides.

However, let's say user(=camera) makes a circle around the model clockwise, he'll pass through the right side and appear on the left.
When eyes reach the right border, they become fixed, and when user appears on the left, eyes jump to the left side

This kind of jumps make eyes appear a little awkward, so I want to smooth their movement out.
Do you have any ideas on how to do that?

// Make eyes look at the camera
        protected void _Eyes()
        {
            // Reference direction of the gaze
            refDirectionLeft = _v3OldCamPos - leftEye.transform.position;
            refDirectionRight = _v3OldCamPos - rightEye.transform.position;

            // Actual direction of the gaze
            directionLeft = this.transform.position - leftEye.transform.position;
            directionRight = this.transform.position - rightEye.transform.position;

            // Angles between actual and reference directions
            angleLeft = Vector3.Angle(refDirectionLeft, directionLeft);
            angleRight = Vector3.Angle(refDirectionRight, directionRight);

            if (angleLeft < limit)
                leftEye.transform.LookAt(this.transform);
            else if (angleLeft > limit * 3)
                leftEye.transform.LookAt(_v3OldCamPos);

            if (angleRight < limit)
                rightEye.transform.LookAt(this.transform);
            else if (angleRight > limit * 3)
                rightEye.transform.LookAt(_v3OldCamPos);
        }
grand venture
golden zenith
#

Good evening then ! ))
Thanks for the advice, I will take a look at those

golden zenith
#

YOOOOOOOOO HOOOOOOOOOOOOOOUUUUUUUUUUU

#

bro thank you very much!!

#

now it does look like a real human eyes when they move

#

Quaternion.RotateTowards did the trick, though I have to optimize because my code is doing many unnecessary calculations

#

@grand venture thanks a lot!

grand venture