# How to move an actor in the view port using python

**URL:** <https://forums.unrealengine.com/t/how-to-move-an-actor-in-the-view-port-using-python/486086>\
**Category:** Editor Scripting\
**Tags:** Python, move-actor, unreal-engine, question\
**Created:** [July 12, 2021, 9:32am UTC](https://forums.unrealengine.com/t/how-to-move-an-actor-in-the-view-port-using-python/486086 "2021-07-12T09:32:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4288d6f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4288d6f2](https://forums.unrealengine.com/u/anonymous_user_4288d6f2)\
**Post date:** [July 12, 2021, 9:32am UTC](https://forums.unrealengine.com/t/how-to-move-an-actor-in-the-view-port-using-python/486086/1 "2021-07-12T09:32:08Z")

</div>

Hello, there good people.  
I have been working with python in the unreal engine for a couple of weeks now.  
So I want to move an actor from point A (0,0,0) to point B(0,300,0). Right now I was able to move the actor from point a to point b directly.

![343886-did.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/f/a8fc92336b26e59dbc7ba908d57b614e9203ffe9.png)

What I want is to move the actor from point A to point B with a smooth transition.

![343888-nedd.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/0/9c0e53a381afe9603b592dd5d703b8faa0d7bfc6.png)

I have tried using a loop, which iteratively changes the y-axis value, which did not work, the code directly teleports the actor from point a to point b.

```
import unreal as ue
from unreal import EditorLevelLibrary as el
from unreal import VPBlueprintLibrary as vpbl

actors = el.get_all_level_actors()
for actor in actors:
    if actor.get_actor_label() == 'cube_bp':
        for i in range(1, 300, 30):
             actor.set_actor_location(ue.Vector(0,i,0), True, False)

```

I have also tried to refresh the viewport after every iteration, which also didnt work.

```
import unreal as ue
from unreal import EditorLevelLibrary as el
from unreal import VPBlueprintLibrary as vpbl
    
actors = el.get_all_level_actors()
for actor in actors:
    if actor.get_actor_label() == 'cube_bp':
        for i in range(1, 300, 30):
            actor.set_actor_location(ue.Vector(0,i,100), False, False)
            vpbl.refresh3d_editor_viewport()

```

Can you please help, how I can do it, or is it possible to do it with python?  
Note: I am new to this forum, so please consider my mistakes.  
Thank you.

---

<div class="post-metadata">

**Author:** ![jeeva\_s](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jeeva\_s](https://forums.unrealengine.com/u/jeeva_s)\
**Post date:** [January 7, 2024, 3:56pm UTC](https://forums.unrealengine.com/t/how-to-move-an-actor-in-the-view-port-using-python/486086/2 "2024-01-07T15:56:57Z")

</div>

How to make the actor move into different Location with some delay(too known the different movement of actor) using python.  
Note: Not a single direction.
