Hand animations

0 favourites
  • 7 posts
From the Asset Store
Experience the true heartbeat of combat with "Combat Hits - Hand To Hand Fighting SFX."
  • Ok so I was wondering how I would make the hands of my character follow my mouse position a a certain radius of my character. What I mean is, I have my character and my hands in seperate sprites, the hands follow my mouse a bit like a cursor but it can only go a certain distance from my character.

  • Global Variable HandDistance = 40 // Distance between body and hand in pixel
    System: Every tick
       -> Hand: set X to cos(angle(Player.X,Player.Y,Mouse.X,Mouse.Y))*HandDistance
       -> Hand: set Y to sin(angle(Player.X,Player.Y,Mouse.X,Mouse.Y))*HandDistance
  • Global Variable HandDistance = 40 // Distance between body and hand in pixel
    System: Every tick
       -> Hand: set X to cos(angle(Player.X,Player.Y,Mouse.X,Mouse.Y))*HandDistance
       -> Hand: set Y to sin(angle(Player.X,Player.Y,Mouse.X,Mouse.Y))*HandDistance

    Yann: You are really into math, arent you? <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Wow haha thanks alot Yann <img src="smileys/smiley16.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Eh I guess this is in real programming or its in the events ? sorry haha I'm not use to the program yet and is there a window to see code ? cuz I know a bit of javascript from using Unity engine, I didnt look at what language C2 can use yet.

  • Oh ok I got around in the events haha sorry I dont recognize everything yet haha but thanks realy.

  • When you get the hang of vector math it's always the same thing

    cos(a) gives you an X projection of the unit vector at angle a

    sin(a) gives you an Y projection ot the unit vector at angle a

    Just have to scale a unit vector by the magnitude (distance) you want it to be and you're done.

    (vector and position are almost the same thing... they share common notation)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)