Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Adjust camera zoom dependency with character speed

Hi there.

As you saw in many games when character start to run or sprint camera truck back to emphasize the character speed. So I tried to imitate the effect by using my character velocity length and camera FOV. But the direct relation between camera and speed makes some troubles. mainly when speed goes to zero immediately, camera jump to start distance.

I thought of using Lerp(float) or ease functions but there is no certain point for starting the lerp or there is no relation to speed here just lerp between two states.

So can you help me with a standard method to achieve this effect?

Thank you

Product Version: UE 4.19
more ▼

asked Aug 15 '18 at 01:05 PM in Blueprint Scripting

avatar image

47 1 3 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You're going in the right direction. Use fInterp (or Ease) with MapRange node in order to obtain relative values.

edit: This could be a good start:

alt text

You may need to tweak it a bit to make if feel right:

Image from Gyazo

capture.png (196.2 kB)
more ▼

answered Aug 15 '18 at 01:32 PM

avatar image

15.2k 77 25 62

avatar image mosssi Aug 15 '18 at 02:31 PM

That's what I was talking about. Thank you @Everyone. This is a full setup here. I just used VelocityLengthXY instead of VelocityLength and InterpSpeed of 1.5 and its all fine.

Just a quick question yet. FInterp To is a function which interpolates two values over game time with a desired speed but Ease functions and Lerps use Alpha for interpolating values. So is it possible to use them in this situation? I think FInterp To is the only option here.

avatar image Everynone Aug 15 '18 at 02:32 PM

You could use Lerp, Ease, fInterp To (or even fInterpToEaseInOut). But they all work slightly differently.

Lerp is the simplest and fill follow the alpha linearly (there's no built in additional interpolation); however, the alpha itself does not need to be linear, you can design a curve and feed it to the Lerp node which will then stick to it precisely. You can feed it world delta seconds, too but then your frame time becomes your interpolation speed, meaning you have no control over it whatsoever. Lerp works really well with Timelines as you can shape the curve in its editor and get a very consistent result.

Ease has a bunch of built in functions (including linear), some of them have exposed exponents which allow you to further control the interpolation. Setting Ease to Linear makes it behave pretty much like Lerp. Ease is like a very flexible fInterpTo?

fInterp To (not the constant one) - it always felt to me like a simple Ease with In Out but with a magical InterpSpeed attribute instead that acts like a flat multiplier, making it user friendly.

fInterpToEaseInOut - same as above but an actual power exponent is exposed rather than Interp Speed multiplier. (?not 100% sure)

I hope I did not mix anything up.

avatar image mosssi Aug 17 '18 at 12:00 AM

You are really an amazing person. I learned a lot from this post. I didn't know that I can feed Alpha value with WorldDeltaSeconds. I can't imagine how delta seconds works as alpha yet but that's OK for now.

Thank you so much

avatar image noc Nov 05 '18 at 05:39 AM


this is wonderful. thank you. I tried this blueprint for camera position and rotation instead of FOV but I failed. do you have any solution for that? FOV changes not look so good on my side scroller prototype but I believe camera position gonna work.

avatar image Everynone Nov 05 '18 at 08:04 AM

I tried this blueprint for camera position and rotation instead of FOV but I failed.

@noc: you'd need to be a bit more descriptive than that. Perhaps start a new thread and describe your expectations regarding how a system you envisioned should work; mention what what you've tried and attach a screenshot of the blueprint that's misbehaving. It usually helps a lot.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question