Character "look" always at mouse position

  • #1, by denis-Sunday, 23. February 2014, 22:22 11 years ago
    Hello folks!
    I have a question... it's possible to set character always "look" at direction of mouse in standing animation?!? (es. if mouse is in right screen character change align to right... if mouse is at left...character align at left..(easy not?!?))grin
    Thanks!

    Newbie

    74 Posts


  • #2, by afrlmeMonday, 24. February 2014, 00:24 11 years ago
    yeah I don't see why not...

    you would need to create a loop which checks if characters current state is idle & if so then get current mouse pos & do a bit of math (not my strong suit) to determine which direction the character should be aligned to.

    check out this compass script & demo by einzelkaempfer: https://www.visionaire-studio.net/shop/article/skript-demons... - the compass rotates around based on the current position of the mouse cursor in the scene. you could effectively take this script & modify it to suit your needs.

    Imperator

    7285 Posts

  • #3, by denis-Monday, 24. February 2014, 13:12 11 years ago
    Thanks Lee!
    i tried to see how it work but.... it's a little bit hard. Anyway the idea was right!

    Newbie

    74 Posts

  • #4, by afrlmeMonday, 24. February 2014, 14:23 11 years ago
    I haven't actually looked over the kompass script yet, so I'm not sure at the minute either! wink

    Imperator

    7285 Posts