Announcement

Collapse
No announcement yet.

"Finterp to" isn't transitioning smoothly

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

    "Finterp to" isn't transitioning smoothly

    I've tried hooking up Delta Time to Get World Delta Seconds and Event Tick, with the Interp speed set to all sorts of values, but the switch from the current float value to the target float value is like the flick of a switch, like it's instantly switching. Am I doing something wrong?

    #2
    probably...but without posting a setup thats broken for you its hard to guess whats wrong...for me that node always worked like it should.

    Comment


      #3
      Hi hippowombat!

      For a minimal working example, here's an Actor Blueprint that moves a static mesh component until its relative Z location equals 100, on tick, using FInterpTo, without any flick-of-a-switch type movement, but somewhat rather smooth:

      Click image for larger version

Name:	FinterpTo.png
Views:	1
Size:	87.5 KB
ID:	1081626

      Comment


        #4
        Hey guys, thanks for all the replies!

        Xenome, I tried your setup (edited for mine, of course) but still am getting the sudden switch.

        Here's what I'm wanting to use Finterp to for. I have a time of day/weather system I'm working on. Depending on the spot in different timelines, lots of values are being changed. For example, my directional light actor changes intensity based on the, "time of day," which is dictated by it's current rotation angle on a 2400 second timeline. However, I also have 3 different, "weather cycle," timelines, that will affect the values of the time of day cycle additively, so that I can have weather patterns change less uniformly. Basically, say it's sunny. My time of day system by itself was built on a sunny profile, so things like sun intensity are just multiplied by one for, say, 400 seconds. Then, after the sunny profile timeline plays through, I have an event to fire to select one of the three weather profiles based on a pre-determined probability. So say next it lands on rainy. Out of the gate, the highest intensity I want my sun to be is 1, (during sunny it's at 20) so that it seems like cloud cover (which is just a texture) is blocking out more light, and affecting overall brightness, like it does when it's cloudy/rainy. So for the duration of the 400 second rainy timeline, it's feeding a number (0.1) up to a float * float node, and multiplying that by the current sun intensity on the 2400 second timeline. However, I want it to fade smoothly, and having it set up this way would allow for each weather pattern to affect things like sun intensity, cloud cover, etc, additively, at any point in the day/night cycle, which is a different length than each of the 3 weather pattern timelines, so subtracting/adding values straight across wouldn't really work, because if say Cloudy played multiple times in a row (something the probability system allows) it could subtract values repeatedly, making it waaaay too dark, whereas if it just multiplied the default Sun brightness by the same number multiple times in a row, it would get as dark as it should and no darker, allowing the system to play over and over without issues. My problem is, I'm running the outcome of the default sun intensity * the weather pattern's current multiplier into the target value of Finterp to, with the base being just the original sun intensity value as dictated by the time of day system, but it's just suddenly changing values from 1 to 20 during switches, as opposed to fading smoothly.

        Sorry if the explanation seems weird, I'm new to programming in general and this confuses me a lot, though I think in theory it should work. Here's a picture of my finterp to/sun intensity node setup as I described above.

        Last edited by hippowombat; 07-12-2015, 09:38 PM.

        Comment


          #5
          Originally posted by hippowombat View Post
          I tried your setup (edited for mine, of course) but still am getting the sudden switch.
          Can you please try it as shown in a new actor blueprint, place it in your level and play, just to verify that there isn't something wrong with your editor (highly unlikely, but you know... never assume, always test).

          Originally posted by hippowombat View Post
          <lots of text>
          OK, so I didn't really try to parse that, but looking at the screenshot of your setup, you have some weird concurrency going on there by the fact that there's a timeline, itself ticking because that's what timelines do, and then on top of that the ordinary tick event injecting itself into that very same execution thread. This seems (to me at least) like a rather messy situation that's potentially very difficult to debug (as you have found out).

          Assuming that the simple example FInterpTo works as expected on your system, you probably want to rethink the way you are driving your sun/weather parameters and come up with something that's a bit cleaner and easier to debug.

          EDIT: Addendum:

          Originally posted by hippowombat View Post
          I'm new to programming in general and this confuses me a lot
          As a general piece of advice - when you are programming, you are also collaborating with your future self. Always make sure he doesn't get mad at your present self
          Last edited by Xenome; 07-13-2015, 04:01 AM.

          Comment


            #6
            I wasn't really able to do this with a static mesh, because, at least in 4.8, set relative location takes in a vector parameter, and not a float. However, I did test Finterp to using a spotlight actor to raise it's intensity from 0 to 5,000,000 at a rate of 0.005, and it smoothly built up to that intensity as I want it to in my weather blueprint.

            here's a picture of my spotlight test:

            Click image for larger version

Name:	UE4Editor 2015-07-14 18-51-14-03.png
Views:	1
Size:	205.7 KB
ID:	1081748

            Comment


              #7
              Update: I've tested Finterp to on the other situation, even having the target float value being multiplied by other numbers, just to see, and it works just fine.

              A more basic explanation of what I'm trying to do:

              My directional light actor's intensity changes on a 2400 second timeline. I want the scale that it ranges from to be affected by other timelines, that output a number to multiply the intensity by. (For example, to make it less intense, I have a timeline that outputs a, "weather sun intensity," float value (0.1) that my Finterp to node references to multiply my default sun intensity by. So, for 400 seconds, (the duration of that weather cycle) the sun doesn't shine as bright. This'll be applied to other values like cloud opacity, fog, etc, for weather cycles.

              But I think my issue is the Delta Time input. My Directional Light Intensity is controlled by a timeline, not by event tick, so I'm not sure what to put into the Delta time input in my Finterp to node.

              Here's another snapshot of my setup, I'm not sure why it's not working, though. Remember, Weather Sun Intensity is just a multiplier to change the scale that the sun intensity ranges from. It's not changing the sun intensity at all, which I tested to find out by having it print the sun intensity value that's put out by the finterp to node, and it's the default value that's put out by the default sun intensity timeline. Is there a value I can put out of a timeline that would work for Delta Time in finterp to?

              Comment


                #8
                Use Play From Start

                Comment


                  #9
                  I don't understand, how would that affect finterpto?

                  Comment


                    #10
                    Ah, whoops, ignore that. What you want to do is "Get World Delta Seconds" and hook that into the delta time. You may need to mess with the interp speed to get the results you want as well.

                    Comment


                      #11
                      That one isn't working either :/ it's either returning the default sun value, or something super close to it, but it's not scaling/transitioning towards any other values.

                      Comment


                        #12
                        Bump, still seeking a solution to this issue.

                        Comment


                          #13
                          Finterpto isn't working

                          Has anyone else experienced difficulty with FInterpto? My current and target values can and do change at runtime, and it picks up on that and the output value adjusts accordingly, but no matter what I do with the interp speed and delta time, it just abruptly changes values as opposed to transitioning smoothly like it should, I believe it's because when the target value changes, it just jumps directly to outputting that value, rather than transitioning to it from the current value. It's been stumping me for longer than I'm proud to admit.

                          Comment


                            #14
                            Try using a TimeLine instead.

                            If you right click in a BP there should be an Option in the context menu down the bottom that says, add new Timeline.

                            You can define any type of curve to transition from one value to another.

                            Check the documentation out or search Youtube for tutorials on Timelines.
                            Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

                            Comment


                              #15
                              You have your FInterp node within a function/event that updates every frame, yes? (For example Event Tick). If not, you'd need to do that first.
                              Song of Horror's official website
                              Song of Horror Facebook , Twitter and YouTube
                              Check us out on our Forum thread too!

                              Comment

                              Working...
                              X