How to make eyes follow your mouse?

Game Editor comments and discussion.

How to make eyes follow your mouse?

Postby ThaKid244 » Mon Jan 10, 2011 3:24 am

Hey what's up. I was wondering how to make a character's eyes follow your mouse movement without them passing through the eye lids/border, as if staying in a contained area. I have attached my attempt at this. Could anyone help me with this?
Attachments
Following Eyes.ged
(1.62 KiB) Downloaded 55 times
K Thanks! ;)
User avatar
ThaKid244
 
Posts: 34
Joined: Thu Dec 23, 2010 6:40 pm
Score: 0 Give a positive score

Re: How to make eyes follow your mouse?

Postby skydereign » Mon Jan 10, 2011 4:12 am

I'd do it like this. Since the eyes will always be next to each other, you should make it a single animation and actor. What I did in this is find the direction from a face actor to the mouse, and use cos/sin to set the eye's xy. The eye actor is always on the circle around the face. To change the distance, change the 20 in the eye's draw script.
Attachments
eyes.ged
(1002 Bytes) Downloaded 74 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron