playMaker

Author Topic: Editing Animation curves.[SOLVED]  (Read 3878 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Editing Animation curves.[SOLVED]
« on: November 11, 2013, 11:47:17 AM »
Hi,
I have a model that has a Legacy Animation (Jump) and I want to move if forward by about 10 units using an animation curve.  Problem is, I can edit it fine, make it look how I want it, but when I start the scene and I get the model to do the jump, it moves from its current position to a new position, then returns to the previous position.  So, I made the model as a child of an empty gameobject and reset its positions to 0,0,0 but it still moves to a new position when the jump is called.
So what can I do to keep the animation curves relative to the current model position?
« Last Edit: November 14, 2013, 12:24:17 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Editing Animation curves.
« Reply #1 on: November 12, 2013, 01:21:15 AM »
Hi,

 you need to save the animation sample in a vector3, and ADD this to the initial jump position. So when the player jumps, you record eht player position in a variable "Jump initial position", and you use that as a base to add your jump curve sample.

 does that make sense?

bye,

 Jean

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #2 on: November 12, 2013, 03:42:47 AM »
Hi,

 you need to save the animation sample in a vector3, and ADD this to the initial jump position. So when the player jumps, you record eht player position in a variable "Jump initial position", and you use that as a base to add your jump curve sample.

 does that make sense?

bye,

 Jean

Yes, I understand what you mean, except how do I save my forward movement curve in a Vector3?  I'm using the same animation clip for the jump, and just creating a curve to move that forward.

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #3 on: November 12, 2013, 04:53:41 AM »
I thought making a parent for the object would work, I don't get why it jumps back to where I made the clip? Could it be something to do with the jump animation or how I imported it?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Editing Animation curves.
« Reply #4 on: November 12, 2013, 05:32:14 AM »
Hi,

 Are you using a clip or an animation curve?

maybe you haven't cut your anim properly and the last keyframe is going back to the original spot?

bye,

 Jean

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #5 on: November 12, 2013, 06:01:07 AM »
Hi,

 Are you using a clip or an animation curve?

maybe you haven't cut your anim properly and the last keyframe is going back to the original spot?

bye,

 Jean
It's a jump animation clip that is on a model I have. So I'm using the jump animation clip then opening up the animation window and editing that clip and moving the z curve so the whole model moves forward.

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #6 on: November 12, 2013, 07:24:05 AM »
I have the parent, and the child (the model with the animations)
And playing around with it, I've noticed the model moves around fine, but its parent doesnt move with it.  And that is where the animation jumps back to, the parent.
So Jean, I dont know if that helps.  I just assumed the parent would move along with it?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Editing Animation curves.
« Reply #7 on: November 12, 2013, 08:11:40 AM »
Hi,

 Nop, only the object targeted for the anim AND it's children will be subject to the animation, parents are unaffected.

bye,

 Jean

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #8 on: November 12, 2013, 08:45:35 AM »
Hi,

 Nop, only the object targeted for the anim AND it's children will be subject to the animation, parents are unaffected.

bye,

 Jean

thanks, so how do I get the parent to move along with the child?
Or is there something I'm missing?  It seems long winded for something that is simple.  All I want to do is move an object forward whilst the model is playing an animation.  Is there anything else to try?

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Editing Animation curves.
« Reply #9 on: November 12, 2013, 03:49:40 PM »
Ok I've done it, pretty much what Jean suggested earlier.  So if anyone else has the same problem, use get position and get rotation on your animation object, and then use set position/rotation on your parent.  Seems a long way to do it, but it works.