How to Move an Object Along Axis a Specified Amount

Hi,

what I’m looking to do is very simple, but something I’ve been trying and for the most part failing to do for a couple days now. Basically, I have a Blueprint actor that I want to move 100 units along the X axis every 10 seconds in a smooth transition, always from its current position. What I have, shown in the images, works for the most part - my main issue is that the object moves forward only approximately 100 units - with the seemingly random value of -2.6. Unfortunately I need it to move exactly 100 or eventually everything goes wrong. If anyone could give me a hand, I’d be very thankful.

Here is what I currently have: Unreal Engine 4 Help Moving Object Forward Repeatedly - Album on Imgur

Hi Alessandro, Wow thanks a lot, that works perfectly! :slight_smile: Thanks for the tip, your explanation makes perfect sense so won’t make that mistake again! I was wondering why it was moving forward seemingly a different amount every time before!

Hi Andrew,

Try this instead. The problem in your blueprint is that you are constantly taking the new location of the actor, while you should just save the original location and add the curve, with the curve set to finish at 100, so you can be sure it moves exactly 100 units. The way you are doing means that the curve value is added at each frame, and that value depends on the frame rate, so it will vary from machine to machine.

Let me know if it works.

Best regards,
Alessandro

No worries, glad it worked.

Best,
Alessandro

Please mark the answer as correct to close it :slight_smile: