Announcement

Collapse
No announcement yet.

My question about Blueprint FInterpto...?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    My question about Blueprint FInterpto...?

    Hi ;

    In Event Graph , by pressing "spacebar", I would like to interpolate between value "A" to "B" , smoothly :



    Unfortunately , It doesn't interpolate and just jumps from A to B.

    Thanks for helping.
    MSD.
    Attached Files
    MSD

    #2
    Are you completely sure it's instantly jumping from 0 to 1?

    The way you have it set up, it's going to go up by 0.2 every frame, which would likely be somewhere around 1/60 of a second in my experience.

    Try printing out the values each tick and see if you get:

    Spacebar pressed
    1
    0.8
    0.6
    0.4
    0.2
    0
    0
    0

    I think it may be working, just happening really fast.

    Comment


      #3
      Originally posted by MSD View Post
      Hi ;

      In Event Graph , by pressing "spacebar", I would like to interpolate between value "A" to "B" , smoothly :



      Unfortunately , It doesn't interpolate and just jumps from A to B.

      The next time it would be (1-0.1)
      Thanks for helping.
      MSD.
      You want to set your target to 0 or 1. Your Current value should come from whatever you are setting in your return value. For instance:

      You have float X.
      X = 0
      You press your space bar and now X should move toward 1.
      Get the value of X and plug it into your current
      Target is now 1
      Based on Delta Time and Interp Speed your return value will = X+((1-X)*dT*InterpSpeed )(I think that is the math, I'd have to look at the source). So if Current =0, dT is .05 and interpSpeed is 2, and target is 1.

      X=.1
      X=.19
      X=.271
      etc.

      This is why interpTo starts fast and slows towards the target. If you want a constant speed from current to target you can use the interpToConstant node.

      Comment


        #4
        Hi Predatoria ; To check what you said, I don't know how could I printing out the values each tick ...

        Hi James94Hodges ; I want to set my target from 1 to zero. and I changed my node to interpToConstant, but I get same result.
        MSD

        Comment


          #5
          Originally posted by MSD View Post
          Hi Predatoria ; To check what you said, I don't know how could I printing out the values each tick ...

          Hi James94Hodges ; I want to set my target from 1 to zero. and I changed my node to interpToConstant, but I get same result.
          What James94Hodges is referring to is the "Current" input you have.

          The interp node needs to be called each tick / each frame. And "current" needs the current value of whatever you want to interpolate. It can not be a static number. The target can be whatever you desire. But "current" needs to be the current value. And you have to store the result in the variable that feeds current so you have continuous updates. And not a similar number all the time. Because you come from a static number and want to a static number.

          Comment


            #6
            Hi Erasio ; I got it and now it works , thanks everyone.
            MSD

            Comment

            Working...
            X