playMaker

Author Topic: Why doesn't Curve Float- action have "Set to value"- option?  (Read 2775 times)

troubleMaker

  • Playmaker Newbie
  • *
  • Posts: 25
Why doesn't Curve Float- action have "Set to value"- option?
« on: September 17, 2014, 03:30:11 PM »
I found another post on this asking how exactly the Curve Float action works, but it seems to have never been resolved.

So i simply want to use the action animate an arbitrary variable to zero, but don't have any luck because i don't really understand which calculation method i should choose and how the curve relates to the TO and FROM values. Is zero on the Y-axis the FROM value, and one the TO value. Or the other way around?

Also on what value is the calculation method applied? I don't really even understand how this action has any other than "set to value" since the TO value we are trying to reach with this action, right?

Anyway, thanks a lot to anyone who can clarify how to use this =)


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Why doesn't Curve Float- action have "Set to value"- option?
« Reply #1 on: September 18, 2014, 09:49:59 AM »
Hi.

 Curve float animates from whatever value you have in your curve. if you want to animate to 0, your curve end point must be 0.

 Or am I missing the point?

 Bye,

 Jean

troubleMaker

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Why doesn't Curve Float- action have "Set to value"- option?
« Reply #2 on: September 20, 2014, 07:03:22 AM »
Well the way i thought, or would want the action to work would be that the 1 and 0 values on the Y axis of the curve would correspond to the FROM and TO values, so i wouldn't have to "hard code" the values to the curve as it seems with Animate float. So i could animate from values X to Y, which might be 0 or might not be.

What i'm trying to achieve is a sort of faked dynamic physics behavior, where Playmaker would check the position of the object, set that as the FROM value and then animate it on the curve to the TO value, which might be 0. But i can't get this to work, and i always get completely crazy behavior from Curve Float. Animate Float is easy to manage, but there it seems obvious to me that you have to preset your values in the curve editor, and that it can't really work with changing variables.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Why doesn't Curve Float- action have "Set to value"- option?
« Reply #3 on: September 23, 2014, 05:12:06 AM »
Hi,

 then you have to do a composition, and use the value you get fromt he curve as a "relative" offset to your actualy vlaue in game.

 so instead of setting the value, save the starting point of your value, and add the current curve float, then you'll achieve a relative offset based on a curve.

so if you want to do a jump with a curve. store the initial position of the player when jump is pressed, then sample the curve and add to this initial value. then the player will jump where ever he is in the world.

 Bye,

 Jean

troubleMaker

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Why doesn't Curve Float- action have "Set to value"- option?
« Reply #4 on: October 21, 2014, 03:40:27 PM »
Hi,

Thanks for the reply Jean, but i'm not really sure if i understand. What's a composition for instance?

Is there any way you could provide a really simple example scene?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Why doesn't Curve Float- action have "Set to value"- option?
« Reply #5 on: October 22, 2014, 02:23:08 AM »
Hi,

 Ok, please find a new custom sample showing how to move and jump a character without physics.

Download AnimateFloat Sample Package

 The jump is using AnimateFloat that is "composed" back into the input Vector3 variable on the y axis, making the object go up and down in the air. Notice that you can still steer while you jump.

notice the curve, it's a default curve available in the curve editor, it goes up and down because I fake input and so for the cube to move up and down as well.

Hopefully, this will explain how to compose variables together and how you can use curves.

Bye,

 Jean