Search Unity

Is it possible to animate 3D object frame by frame?

Discussion in 'Animation' started by helenedwards, Oct 14, 2016.

  1. helenedwards

    helenedwards

    Joined:
    Oct 14, 2016
    Posts:
    6
    What i exactly need is ability to stop that one (single) animation in the X point, and ability to move it back and forth.

    Simple example:

    Imagine chopping a tree using a mouse. You need to move mouse left and right, if you stop - animation stops. If you don't swing to the right enough, tree won't get hit and if you move mouse back to the left - character's arms and axe will go to the left again.
    ringtones247.net
     
    Last edited: Apr 11, 2020
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
  3. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    If your game resembles anything like typical survival games (Minecraft, 7DTD, The Forest,...) and isn't pure VR, then I think this is a bad and annoying mechanic.

    Anyway, what you are describing sounds like you might want to look into Final IK for tweaking animations at runtime:
    https://www.assetstore.unity3d.com/en/#!/content/14290
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    AnimationState.time should do the trick for you.

    For even more flexibility you can always read the values off the animation curves yourself. It's not challanging to do, even if it is time consuming.
     
  5. armstrong255

    armstrong255

    Joined:
    Jan 25, 2020
    Posts:
    1
    Start by opening a new Blender document. Select the default cube. Ensure that the timeline is showing that you are at frame number 1. Press I , and choose “Location”; this will insert a keyframe at frame 1 which remembers the current location of the cube. Move the current frame (green line) away from frame 1, and you will see that there is a yellow line left behind. Free mp3 Ringtones for Mobile Phones

    Now go to, say, frame 25. With the cube still selected, press G, and move the cube to a different position—anywhere a few cube widths away will do fine. Press I again, and insert another Location keyframe.

    Now try scrubbing with LMB between the two yellow lines in the timeline, and watch the cube move smoothly between the two positions you set as keyframes.

    Now press ALT + A , and Blender will automatically cycle through the timeline for you, animating the cube as it goes. There will probably be a long pause in the motion after it gets to frame 25 because by default the animation will run until frame 250. Press ESC to stop the animation, click in the box at the bottom of the timeline labelled “End:”, and reduce the end frame number to, say, 50. Press ALT + A to start the animation again, and watch the movement cycle through a little more quickly this time.

    Stop the animation, go back to frame 1, and press ALT + I to delete that first keyframe. Move the current time away from frame 1, and confirm that the yellow line that was there has gone. Now restart the animation; what happens? You should see the cube snap to the location specified by the only remaining keyframe, and stay there. Without a second keyframe specifying a different value for a parameter, Blender sees no reason to change the value for that parameter to anything else. Hence the rule: