x

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 can I move an object over a set amount of time.

I have an object that I'd like to interpolate from vector A to vector B. But I'd like to be able to dynamically set how long it will take to get to vector b. So for example I could input time 4 seconds, and the object would interpolate from vector A to vector B over 4 seconds. I need to be able to set this dynamically during play. If someone could explain to a semi noob the math for accomplishing that. Or maybe there's a blueprint node I'm not aware of. I'm currently using a timeline with an ease node and I can't seem to accomplish what I want with just that.

Product Version: UE 4.16
Tags:
more ▼

asked Feb 11 '18 at 12:06 AM in Blueprint Scripting

avatar image

Ornotwell
1 1 3

avatar image Dino zavr Feb 11 '18 at 07:48 AM

Well, you can use tick event with vinterp to with world delta seconds, and event trigger to enable and save the destination vectors and pass it in the tick. Like you have custom event with entries vector destination and is_move boolean enabled/disabled, that event set passes to real variables, which gets checked in tick, if boolean is true, it will vinterp from object current loc to saved destination vector variable, and also check if his location is equal to destination, if its true then call that event with disable bool entry to stop. You can also set the interp speed in vinterp node.

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

2 answers: sort voted first

Timelines would definitely work. I actually just built something like this. You could also check out the Interp to Movement component, which adds that functionality to any blueprint without any real coding involved.

Timeline way: alt text

The interp to Movement component exposes these settings: alt text

Here's where you find it: alt text

And of course, you could use both. Meaning: Use a timeline setup like in the first example, to drive the parameters of an Interp to Movement Component. Good luck!

more ▼

answered Feb 11 '18 at 08:41 AM

avatar image

ojcruz
131 6 6 12

avatar image ThompsonN13 Feb 11 '18 at 03:32 PM

the problem with a timeline in this case is that he wants to modify the duration length via a variable which cant be done with timelines.

avatar image ojcruz Feb 11 '18 at 05:44 PM

Hmmm... Not true. My example does that. In recent versions the folks at ue4 have added a number of nodes used to modify timelines this way. In my picture, I'm setting the play rate of the timeline on begin play using a duration float.

To clarify: When you create a timeline on ue4.18, it adds a component variable which can then be added to the event graph. When you pull from that variable, you get a bunch of useful timeline related goodies. alt text alt text

avatar image ThompsonN13 Feb 11 '18 at 06:46 PM

ok ill admit i was a bit wrong there. that node doesnt change the length of the curve though right?

avatar image ojcruz Feb 11 '18 at 06:54 PM

No worries. I actually realized after I posted that the OP is using 4.16 and I can't recall if these features had been introduced then. It might've been 4.17. So I might be a bit wrong too. On your question. Yes and no. You're not modifying the length of the curve, but you modify the speed at which that length is played. So effectively it plays over a longer or shorter time but it's not actually longer per se. There is a node where you can stretch the length of the timeline and it seems to have a setting that stretches the points along with the timeline, but I have never actually succeeded at making it work. The effect of altering the play rate is visibly the same (not as clean maybe), so I just stopped trying that route. But it does exist.

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

Use a timeline,

you can set the time inside it and the vector locations and it will feed the movement over time.

To get the node just type " Add Timeline "

To edit the node double click it.

alt text

youtube video Explaining Timelines https://www.youtube.com/watch?v=v7bdcvGlgIg

Hope this helps

timeline.png (288.9 kB)
more ▼

answered Feb 11 '18 at 12:33 AM

avatar image

Exonfluxx
374 1 5 8

(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