Using Self.Motion.Linear.Velocity for Animation

floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

I’m trying to understand using motion linear velocity for animation.
So here is a pic of my (jumping,flying,landing) actor sequence. I have it broken down into four parts.

1. Idle standing breathing (3 frames),
2. Crouching and leaping (3 frames),
3. Flying and rolling (3 frames),
4. Tucking and landing rising (3 frames),

My question is how can I get all four animation sequences playing where they should,using motion linear velocity. Below is my limited understanding...

Using motion linear velocity = 0, I can get the (Idle) animation working .and I can have it facing the mouse position if I wanted.

With motion linear velocity -1 or 1, I can have the (flying) animation in the right direction needed.

I can trigger the (crouching) image with a mouse button down. But its rather abrupt. Ideally I would like to have a sequence of frames play.

The (tucking and landing) sequence is a tough one for me (See sequence at top no.4). Is there a way to use the proximity of the actor to the (final target) to trigger this.
Heres a video of what I have so far....
http://tinypic.com/m/iqfqmc/2

Comments

  • MichalChMichalCh Member, PRO Posts: 115

    What for do you put all the same images in the same "animation" block? That behaviour animates the pictures you put in. So put just one of each inside and then give it a go.
    If there will be more problems write here so I will drop my spare code of animation (coin) with changing width/height.

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    Thanks for chiming in. They,re not the same images. Each image is slightly different giving it more life , I hope. The animation behavior loops through the (idle images for example) making it look as though he's breathing. The other Blocks of animation (Crouching ,Tucking,etc.) are just my way of finessing the animation to make it look more fluid.

  • MattSodenMattSoden Member Posts: 30
    edited March 2015

    The major issue that I can see is that your animation sequence 4 (the one where the character comes in to land) needs to be triggered before the character actually comes to a stop, so he is seen to prepare for landing by animating as per sequence 4 just as he gets to a close proximity to his target position.

    I think you'd have to keep a constrained magnitude self attribute (DistanceToTarget) going that shows the characters position to his intended stopping position and when that magnitude gets below a certain distance - say the height of the character (200) - then you can trigger the 4th sequence to animate.

    You'd need to fiddle with the figures to find out how fast to run the animation and how far away from his intended stopping position you need to start animating at so the animation runs and it looks smooth.

    So make a new rule Flyin_Left_Landing which could read

    When All conditions are valid
    Attribute Self.Motion.Linear.Velocity.X(Y?) is greater or equal to 1
    Attribute Self.DistanceToTarget is equal to 200 (or whatever)
    
    Animate Sequence 4
    

    I only do Self.DistanceToTarget = 200 as it is only ever going to be at 200 once in each journey. Might be worth making DistanceToTarget an integer attribute even though it tracks a real value as you can then guarantee that a 200 will definitely ( I think) come up as opposed to a 200.128 or a 200.479...

    Your existing Flyin_Left would need to change to

    When All conditions are valid
    Attribute Self.Motion.Linear.Velocity.X(Y?) is greater or equal to 1
    Attribute Self.DistanceToTarget is greater than 200
    
    Animate Sequence 3
    

    Does this make sense?

    ps I love your drawing style, it reminds me of loads of cartoonists I love, especially Moebius and Rick Griffin!

  • SocksSocks London, UK.Member Posts: 12,822

    I'm not sure what relationship velocity would have with the animation ?

    In what way would (or should) differing the velocity change the animation ?

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    Thanks man, I was thinking along the lines of using proximity to target also. I will dig into this and post how it works out. Möbius, you hit it right on the nail. I've just always drawn like that since growing up reading Mad and HeavyMetal.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Here is a rough idea.

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    Thats it!! Thanks a million... I'll dig into it after homework with the kids..BTW thanks for not upgrading. Lately I haven't been able to open demos...

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393
    edited March 2015

    Ok, I love this demo. I really appreciate your taking the time to put it together.

    But I confess I'm a little confused. I'm guessing that all the graphics were positioned heads up to the right to match the flying image? And that was necessary to keep the image in the right heads up position. But then there are rotate to position and rotate to angles through out. When I tried to change the (move to mouse down) behavior to a (move to mouse click) everything goes haywire.

    I think with a little information if I could understood what was going on, I might be able to adapt it to other ways of moving actors, moving to mouse position and ultimately swipe to move.

    PS_ I'm not opposed to working this out by myself if theres a good read on the forum some where let me know.

    Thanks

    Edit: Would this have been easier had I positioned the flying image vertical rather than horizontal?

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393
    edited March 2015

    Heres a video of what I got, still flips a little but I think I can figure that out....Edit: I think it's just the position of the mouse flipping the image.
    http://tinypic.com/m/iqga6e/2

    Worked out a few things , still a little glitchy. Added a click ring indicator and had the player move to that. heres a look at that..

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @floatingwoo said:
    Ok, I love this demo. I really appreciate your taking the time to put it together.

    But I confess I'm a little confused. I'm guessing that all the graphics were positioned heads up to the right to match the flying image? And that was necessary to keep the image in the right heads up position. But then there are rotate to position and rotate to angles through out. When I tried to change the (move to mouse down) behavior to a (move to mouse click) everything goes haywire.

    The reason I put all images facing to the right is because that is the zero rotation. When you have a person standing up vertically, that makes the rotation off by 90 degrees. For me, its much, much easier to remember how everything should rotate when all the images are already at the zero rotation. It might be hard for a graphics person to see this, but from a geometry standpoint, having all images match the actor's zero rotation makes things so much easier.

    But if you can't stand doing it that way, my next bit of advice would be to make all graphics consistently. That is, if you insist on having images rotated 90 degrees from zero, than you gotta do it for all images. (Otherwise trying to keep track of which are, and are not rotated becomes a real mess.)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @floatingwoo said:
    Heres a video of what I got, still flips a little but I think I can figure that out....Edit: I think it's just the position of the mouse flipping the image.
    http://tinypic.com/m/iqga6e/2

    Looking good!

    Yes, the flip is happening because its tracking the mouse position. That will go away if you only do the direction flipping when the click is registered. (Not when the actor is 'flying'.

    But don't get too locked into the demo! There are probably many ways to achieve the effect you want. If its not quite right -- we (you, I, the forum) can probably come up with a closer match.

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    http://tinypic.com/m/iqgcjm/2

    Yeah, I went ahead and re-positioned my png's (all at the zero rotation) and dropped them in,figured that one out....got rid of a few glitches, He still does a funny little backflip and he's on a slant when it first starts..but I'll get that worked out.

    Yes I totally agree,using the Demo as a stepping off point is really where you start to learn, I love this stuff man. As a graphics person I love to see the drawings come to life. If I could do this for a living I would be giggling all day long.....thanks!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited March 2015

    Looking Good!

    @floatingwoo said:
    If I could do this for a living I would be giggling all day long.....thanks!

    You are welcome!

Sign In or Register to comment.