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 consistently add to Actor Location

Hi guys,

Gosh I forgot how this was supposed to be set:

I am getting the actor location and adding 1 unit to its X axis for each tick so that it keeps moving along that vector. The problem is that the actor's speed while it moves is not constant, it slightly changes (due to framerate I guess). I remember that I had to do something with delta time or delta seconds to make the movement speed consistent and unchanging but for the love of me I cannot recall how.

Could you please give me a nudge?

alt text

Product Version: UE 4.13
location.jpg (58.0 kB)
more ▼

asked Sep 14 '16 at 05:21 PM in Blueprint Scripting

avatar image

86 11 16 19

avatar image Sean L ♦♦ STAFF Sep 14 '16 at 05:39 PM

Hey EminorReal,

What I would recommend that you do is use a custom event instead of tick, that way you can control exactly how often your movement is being called.

Have a look at the screenshot I have below to see the blueprint setup I used to achieve a smooth movement result:

alt text

Let me know if that doesn't work for you, and I'll be glad to help you look for an alternative.

Have a great day!

movebytimer.png (105.1 kB)
avatar image EminorReal Sep 14 '16 at 05:59 PM

Thanks for your answer Sean,

Unfortunately that doesn't work for me, the movement of the actor becomes laggy even if I set the units down to 0.00001 increments

avatar image Sean L ♦♦ STAFF Sep 14 '16 at 06:37 PM

Interesting. Would you mind bringing up your console using the ~ key and then typing in stat FPS?

Let me know what your FPS is at currently. It might also be worth setting t.maxfps to something like 30 or 60 depending on the power of your PC to see if that helps you get smoother movement.

avatar image EminorReal Sep 14 '16 at 06:57 PM

that's around 39 and 45fps. Though I do have AA off and that might be the culprit.

avatar image EminorReal Sep 14 '16 at 07:55 PM

So far limiting at 30fps seems to be doing the trick. Thanks man! I'll keep an eye on possible changes but for now this seems to fix it and since the project is an old school 2d 30fps is all I need.

Awesome help mate, thanks again.

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

2 answers: sort voted first

Simple!alt text

more ▼

answered Sep 14 '16 at 08:03 PM

avatar image

59 4 7 9

avatar image EminorReal Sep 14 '16 at 08:11 PM

Ahhhhh yes! Multilpying it right! Gosh my brain sometimes xD

Thanks guys, you've both been very helpful.

EDIT: Ehm, So now that I have two correct answers how do I vote both of them? xD

avatar image plastik21 Sep 14 '16 at 08:14 PM

It's your choice :)

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

hey there, it doesn't work for my character. any help please? my character is walking inplace and when i press w it can't move forward. please help me with any hint.

more ▼

answered May 17 '18 at 04:39 AM

avatar image

6 1 1

(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