# How do I teleport a pawn on solid ground?

**URL:** <https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795>\
**Category:** World Creation\
**Tags:** gravity, ground, teleport, unreal-engine, Ray-Tracing, Physics, Blueprint, question\
**Created:** [December 12, 2020, 9:36am UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795 "2020-12-12T09:36:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UnrealDavide](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealDavide](https://forums.unrealengine.com/u/UnrealDavide)\
**Post date:** [December 12, 2020, 9:36am UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795/1 "2020-12-12T09:36:11Z")

</div>

Pretty self explanatory. I want to teleport a pawn to a location that depends on the player character location. However since my level is not planar at all it often appears underground or floating in the air. How do I fix that? Is there some way to know where the ground is or some other trick that could help me? (I am ok with using both c++ or blueprint even if I generally use blueprint because it’s quicker).  
I tried using ray trace but for some reason it didn’t work out as I expected.

 ![324581-screenshot-2020-12-12-102829.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/4/894855b4a935a3147182c07d929b7ca237a2a29c.png)

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [December 12, 2020, 11:32am UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795/2 "2020-12-12T11:32:46Z")

</div>

your trace should find ground  
what does the debug draw show as found location?

also depending on your pawn you will need to offset the landing location by the distance of your pawn center to its bottom

if it’s a character that would be half capsule height

---

<div class="post-metadata">

**Author:** ![UnrealDavide](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealDavide](https://forums.unrealengine.com/u/UnrealDavide)\
**Post date:** [December 12, 2020, 12:12pm UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795/3 "2020-12-12T12:12:12Z")

</div>

It shows nothing, it would seem he is floating too far away for me to see. I am convinced I am using ray trace in a wrong way

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [December 12, 2020, 1:09pm UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795/4 "2020-12-12T13:09:20Z")

</div>

Hi,

(-) Any specific reason why you trace from a constant z = 2000 to -2000 instead of using the current z position of the character and then using current\_z + 2000 to current\_z - 2000? Cause with a constant z from 2000 to -2000 it will not work if the location you want to hit is higher than 20m or lower than -20m.

(-) Make sure that the “Return Value” of your line trace is true, so that it has hit something, and if it is true and still not working as expected, then try to print also the “Hit Actor” and “Hit Component” (maybe also “Impact Point”) and see if those are what you would expect.

---

<div class="post-metadata">

**Author:** ![UnrealDavide](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealDavide](https://forums.unrealengine.com/u/UnrealDavide)\
**Post date:** [December 13, 2020, 8:57pm UTC](https://forums.unrealengine.com/t/how-do-i-teleport-a-pawn-on-solid-ground/475795/5 "2020-12-13T20:57:51Z")

</div>

No specific reason at all, I just tried with many different z, either constant or dependent on the actor location.  
In any case the return value of the line trace is always false as if it hit nothing but I honestly can’t figure out the reason for this.
