# How can make character teleport (for example) 10m forward

**URL:** <https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 29, 2017, 2:24pm UTC](https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241 "2017-04-29T14:24:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d614ed46](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d614ed46](https://forums.unrealengine.com/u/anonymous_user_d614ed46)\
**Post date:** [April 29, 2017, 2:24pm UTC](https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241/1 "2017-04-29T14:24:51Z")

</div>

So I want to make character teleport forward each time I press ‘T’ button.

---

<div class="post-metadata">

**Author:** ![Two-faced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Two-faced](https://forums.unrealengine.com/u/Two-faced)\
**Post date:** [April 29, 2017, 2:29pm UTC](https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241/2 "2017-04-29T14:29:04Z")

</div>

Pretty easy:

 ![136107-2017-04-29_21-28-34.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/3/df38b8446c7f153efc3df444049a07ae46c73a70.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d614ed46](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d614ed46](https://forums.unrealengine.com/u/anonymous_user_d614ed46)\
**Post date:** [April 29, 2017, 2:47pm UTC](https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241/3 "2017-04-29T14:47:53Z")

</div>

Thanks but now I have another problem. Sometimes it teleports me inside other objects. How can I make character unable to teleport if distance between character and other objects is less than 1000?

---

<div class="post-metadata">

**Author:** ![Two-faced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Two-faced](https://forums.unrealengine.com/u/Two-faced)\
**Post date:** [April 29, 2017, 2:50pm UTC](https://forums.unrealengine.com/t/how-can-make-character-teleport-for-example-10m-forward/392241/4 "2017-04-29T14:50:56Z")

</div>

Try sweep) and the logic here is very simple vector math. You need to learn it before coding anything. I multiplied forward vector because it is normalized. And 1000 is 10 meters.

 ![136108-2017-04-29_21-37-52.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/3/d73907d712958f8e83e4ce8dcff472b7664cf46d.png)
