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"

How to get speed from timeline movement

Hi, I have an object that moves up and down by using a timeline, now I have to get the speed of the object so I can use this speed to move other objects. In the blueprint I used a math equation to calculate the speed, I have the displacement in Z and I divide that by delta seconds. But now for example like you can see on the picture, I have a displacement of 30cm which results in a speed of 1800. But this isn't correct because the object moves from 0 to 30 cm in 0,5 seconds. So how can I get the right speed from the object? Blueprint speed

Product Version: UE 4.21
blueprint-speed.png (159.8 kB)
more ▼

asked Mar 14 '19 at 02:31 PM in Blueprint Scripting

avatar image

1 1 1

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

1 answer: sort voted first

That because you have to multiply by Delta Seconds, not divide by it. Delta Seconds is time betwen two frames, so its value is 0.01 or something like that.

Edit: note that if your actor moves not uniformly, but eases in/out, the velocity that you'll get by multiplying distance by Delta Seconds won't always reflect the true velocity, just average between those points. If you want to drive something else by feeding this velocity value into it, it may be not reaaly what you would expect. Can't you move the other objects with the same Timeline?

more ▼

answered Mar 14 '19 at 02:58 PM

avatar image

1.8k 12 7 9

avatar image houthoofdmaarten Mar 14 '19 at 03:32 PM

Multiply isn't correct I think? Then the speed is much smaller then expected...

avatar image Tuerer Mar 14 '19 at 03:45 PM

Omg, sorry, sure, I was thinking the other way around. My bad.

What is that -96 value? You have to save value 1 on first tick, and value 2 on second, and then compare them. But you have a constant value of -96.

avatar image houthoofdmaarten Mar 14 '19 at 03:52 PM

The -96 is just to get 0 as beginposition

(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