Eyes tracking object

RUPASRUPAS 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

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    edited March 2013
    Hmmm... I'll try to make an example project for you.

    Edit: Well, I've tried just about everything I thought would have worked... Sorry I can't help. Ask @TShirtBooth
  • artfishartfish Member, PRO Posts: 369
    Hey @rupas I did something similar in my unicorn game. Something like this should help or at least get you on the right track.

    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.)
  • RUPASRUPAS Member Posts: 823
    @Utveckla_Games no problem friend, thanks for trying

    @artfish Thanks buddy, I'll try, but I fear it will not be very real
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm working on a demo for you and will post it when it's completed.
  • RUPASRUPAS Member Posts: 823
    edited March 2013
    @tatiang
    oooh amazing! Thanks so much!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Something like this (drag the blue actor around)?
  • RUPASRUPAS Member Posts: 823
    @tatiang
    only one word. INCREDIBLE! indeed, many thanks,thanks,thanks,thanks,thanks.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    * whistles* Nice one, @tatiang!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @RUPAS You're welcome! It's a bit of simple trig but nearly over my head. ;)
  • creativeappscreativeapps Member Posts: 1,770
    @tatiang Thanks for sharing
  • ericzingelerericzingeler Member Posts: 334
    Goodwork tatiang.
  • shurikshurik Member, PRO Posts: 6
    Brilliant Tatiang. Just what I was looking for.
  • NimbleBugNimbleBug Member Posts: 483
    @tatiang Awesome...Goodwork
Sign In or Register to comment.