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"

Good solution? Problems with VInterp and Frame Rate

In my game the player moves objects and the player camera movements are determined largely by VInterps that were being controlled like this, what most tutorials show. However this causes the speed of the object's movement to vary wildly if frame rate changes. alt text I tried to solve this problem like this, and it seems to be more consistent across different frame rates, but I'm unsure of this solution because I don't know if this is an efficient solution or how to adjust the update speed of the timelines that I have to place in every blueprint that uses the Event Tick. alt text Does anyone have any advice on how to keep movements looking consistent across frame rates?

Product Version: UE 4.16
1.png (155.3 kB)
2.png (181.9 kB)
more ▼

asked Jul 23 '17 at 06:39 PM in Blueprint Scripting

avatar image

61 13 17 18

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

1 answer: sort voted first

Using the timeline with a track that goes from 0 - 1 would be a good delta for a lerp. And a better solution.

Also, you don't have to store Delta Seconds, you should instead use Get World Delta Seconds for gameplay mechanics. This will scale based on world time scale.

What is Get World Delta Seconds

Explanation of tick delta time.

Delta time is the fraction of sections that have passed by since the last tick.

When you multiply distance by delta time on tick, you're making that calculation independent of frame rate.

For instance:

  • 1 frame per second: delta time will be the float value of 1

  • 60 frames per second: delta time will be 0.0166666

  • 128 frames per second: delta time will be 0.0078125

Over the course of 2 seconds move an object 5 meters. so you want it to move 5 / 2 meters per second = 2.5 meters per second.

So multiply delta by your speed Delta Time ( DT )

The following is the distance the object will travel in the first second:

distance traveled will be = frames called * DT * Speed

  • final distance = 1 * 1 * 2.5 => 2.5 meters

  • final distance = 60 * 0.0166666 * 2.5 => 2.5 meters

  • 128 frames per second, the tick will be called 128 times.

    final distance = 128 * 0.0078125 * 2.5 => 2.5 meters

The Delta Time changes every tick to account for how long it has been since the last tick, so you don't have to rely on a steady framerate.

more ▼

answered Jul 23 '17 at 10:27 PM

avatar image

2.1k 38 17 52

avatar image masterwigglestin Jul 23 '17 at 11:48 PM

Thanks, I didn't know about the Get World Delta Seconds node.

avatar image masterwigglestin Jul 23 '17 at 11:53 PM

Do you know if I could get a similar problem with Update on the timeline though caused by changes in speed of different speed CPUs instead of frame rates? I wasn't able to find this in the documentation. I wish there was a way to time things directly using miliseconds independent of frame rate.

avatar image BenVlodgi Jul 24 '17 at 06:30 PM

I've updated my answer to include this information.

avatar image laggyluk Nov 25 '18 at 03:54 PM

Also looks like interp methods yeld different results on client and server. I think this should be added to their description so we don't have to learn the hard way.

(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