Eyes tracking object
RUPAS
Member Posts: 823
Hello friend, I have a problem in my game I have two eyes with his pupils, the pupils want to follow an object, that is always the eyes are watching the object, it is quite difficult for the pupils can not get out of the eyes and also when the object is close to the pupils have to go downtown, anyone know? Thank you very much for your help friends!
Comments
Edit: Well, I've tried just about everything I thought would have worked... Sorry I can't help. Ask @TShirtBooth
Create game attributes for your objects x postion and y position. In your object, constrain game.postion.x to self.position.x and constrain game.postion.y to self.position.y.
Now, in your pupils, note the position you have them located at. You can create a few rules for the follow action. Try something like when game.object.postionx is > self.position.x+20 interpolate to your self position to whatever it is + 5. You can do the samething for the y position. You would also need to create the same type of rules for the y position. You could have different increments to make a more convincing illusion. like when game.position.x is > 50, interpolate to your position + 15 or something.
You would want to have opposite rules to for example game.object.postionx is< self.position.x-20 interpolate to your position -5, etc..
I hope that makes sense, or at least points you in the right direction. (There's probably a better way to do it, but this works at least.)
@artfish Thanks buddy, I'll try, but I fear it will not be very real
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
oooh amazing! Thanks so much!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
only one word. INCREDIBLE! indeed, many thanks,thanks,thanks,thanks,thanks.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User