# How to move objects without knowing where will moving end?

**URL:** <https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649>\
**Category:** Cinematics & Media\
**Tags:** moving-object, unreal-engine, Blueprint, question\
**Created:** [July 4, 2017, 8:14am UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649 "2017-07-04T08:14:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bddf1319](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bddf1319](https://forums.unrealengine.com/u/anonymous_user_bddf1319)\
**Post date:** [July 4, 2017, 8:14am UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/1 "2017-07-04T08:14:27Z")

</div>

Hello. I need to know how to move object (camera in this case) but i dont know where will object finish moving. If you dont understand: While left arrow on keyboard is down camera will move left, while right arrow is down camera will move right. I cant know how long user will keep arrow key down. I need to replace SetActorRelativeLocation with something else. Theres blueprint script:

 ![201822-movingobjects.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/f/5ff78c629b00921019f35aca6401b8cf7b1660ec.png)

Any help?

---

<div class="post-metadata">

**Author:** ![AmphDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AmphDev](https://forums.unrealengine.com/u/AmphDev)\
**Post date:** [July 4, 2017, 8:52am UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/2 "2017-07-04T08:52:18Z")

</div>

You need get location first, then add your desired movement vector to original location and set new location.  
Im from mobile so i cant post picture, but in theory for example upwards movement:

NewActorLocation = GetActorLocation + FVector(0,0,1)

This will add 0,0,1 xyz location to your original actor location in each tick, so basically actor will lifting up with 1cm every tick.

Ps. Im recommend do not use while cycle for key press as in your picture, because you will do infinite loop when key is down… use axis binding for this! 🙂  
Axis binds are called/processed in every frame tick, and they can have a value which is 0 when not pressed and any other range of value what you setup in project settings.

That will help to move your camera because 0,0,1 movement vector can be your axis value 😉

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bddf1319](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bddf1319](https://forums.unrealengine.com/u/anonymous_user_bddf1319)\
**Post date:** [July 4, 2017, 11:56am UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/3 "2017-07-04T11:56:12Z")

</div>

How do i connect blueprints and c++ im not good at c++. Also thanks for recommending me axis binds 😃

---

<div class="post-metadata">

**Author:** ![AmphDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AmphDev](https://forums.unrealengine.com/u/AmphDev)\
**Post date:** [July 4, 2017, 1:56pm UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/4 "2017-07-04T13:56:28Z")

</div>

Why do you want to connect c++ and bp? Everything can be done in blueprint what i told you before 😉

---

<div class="post-metadata">

**Author:** ![AmphDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AmphDev](https://forums.unrealengine.com/u/AmphDev)\
**Post date:** [July 4, 2017, 3:26pm UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/5 "2017-07-04T15:26:22Z")

</div>

So im home, this is how need look in BP

> **[Move Camera by Axis up posted by anonymous | blueprintUE | PasteBin For...](https://blueprintue.com/blueprint/ij0c65bj/)**
>
> No description provided

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bddf1319](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bddf1319](https://forums.unrealengine.com/u/anonymous_user_bddf1319)\
**Post date:** [July 5, 2017, 6:53am UTC](https://forums.unrealengine.com/t/how-to-move-objects-without-knowing-where-will-moving-end/399649/6 "2017-07-05T06:53:28Z")

</div>

Nope its still not working. I copy-pasted blueprints i set event but camera is not moving still 😑
