# Conversion FVector to FString not right

**URL:** <https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272>\
**Category:** Character & Animation\
**Tags:** string, conversion, unreal-engine, CPP, question\
**Created:** [June 1, 2017, 5:55pm UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272 "2017-06-01T17:55:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Speckulous](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Speckulous](https://forums.unrealengine.com/u/Speckulous)\
**Post date:** [June 1, 2017, 5:55pm UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/1 "2017-06-01T17:55:43Z")

</div>

Hi,

I’m trying to save Location from a LineTrace to a File.

```
World->LineTraceSingleByChannel(myResult, start, end, channel );

```

And when I try to read the Location I get some … well not a Vector

```
    UE_LOG(LogTemp, Warning, TEXT("Current: %s"), myResult.Location.ToString());

```

![140064-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/9/21991b0d50557dc7c80e688011264f51efa21e24.png)

Someone got an Idea why?  
If I Print i.e. myResult.Location.X it works fine

---

<div class="post-metadata">

**Author:** ![Speckulous](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Speckulous](https://forums.unrealengine.com/u/Speckulous)\
**Post date:** [June 1, 2017, 6:18pm UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/2 "2017-06-01T18:18:55Z")

</div>

When I save the Vector, it works fine 🙂

---

<div class="post-metadata">

**Author:** ![Sentientv2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentientv2](https://forums.unrealengine.com/u/Sentientv2)\
**Post date:** [February 5, 2018, 11:55am UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/3 "2018-02-05T11:55:47Z")

</div>

The %s is denoting a pointer to a TCHAR pointer. You can get this from your FString by dereferencing the result of your ToString() call.

So it would be:

```
UE_LOG(LogTemp, Warning, TEXT("Current: %s"), *(myResult.Location.ToString()));
```

---

<div class="post-metadata">

**Author:** ![Velicante](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Velicante](https://forums.unrealengine.com/u/Velicante)\
**Post date:** [June 22, 2019, 12:26am UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/4 "2019-06-22T00:26:34Z")

</div>

It’s happening the same for me, and yes I am passing the string with the dereferencing operator \*  
Why is this happening?  
I am running UE4 on Mac, is it possibile that it’s trying to print a unicode text?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_57741f591](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_57741f591](https://forums.unrealengine.com/u/anonymous_user_57741f591)\
**Post date:** [June 22, 2019, 1:11am UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/5 "2019-06-22T01:11:22Z")

</div>

Maybe you should post your own question? OP’s question was already answered. It’s also bad form to resurrect old posts from 2 years ago.

---

<div class="post-metadata">

**Author:** ![Gosuri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gosuri](https://forums.unrealengine.com/u/Gosuri)\
**Post date:** [January 8, 2025, 2:11pm UTC](https://forums.unrealengine.com/t/conversion-fvector-to-fstring-not-right/395272/6 "2025-01-08T14:11:29Z")

</div>

Hello, you can also use  
`UE_LOG(LogTemp, Warning, TEXT("Actor location %s"), *ActorLocation.ToCompactString());`
