# 150 Units away from the target

**URL:** <https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104>\
**Category:** Blueprint\
**Tags:** actor-blueprint, unreal-engine, question, Blueprint\
**Created:** [March 21, 2025, 4:34pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104 "2025-03-21T16:34:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuBuSniper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lubusniper/32/571326_2.png) [@LuBuSniper](https://forums.unrealengine.com/u/LuBuSniper)\
**Post date:** [March 21, 2025, 4:34pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104/1 "2025-03-21T16:34:45Z")

</div>

Hello everyone, I want to Move my character to Cube Actor’s location but I don’t want it to be so close, so I subtracted the Cube’s location by 150 units it worked but there is an issue here, I want my character to stay away from the cube 150 units from its location or direction. but it always from to a specific location of the cube.  
basically, i want my character to get close to the cube’s location, and stop when it reaches 150 units

 ![Screenshot (92)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/d/1adf31fdc002ded3f76b54e1664e2531641af443.png)

here is the video

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/6/e76135cfdd39442ec970c2cbef1d05db5210a413.jpeg "Recording 2025 03 21 192623") ](https://www.youtube.com/watch?v=xuVqpFRRZOI)

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [March 21, 2025, 5:01pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104/2 "2025-03-21T17:01:57Z")

</div>

The (Vector - float) math node is some kind of hybrid, that will convert float into a vector (x=150,y=150,z=150) in your case. This absolute vector is always the same, so it will always move to the same point relative to the cube’s location.

What you want to do is substract 150 units in the character-to-cube direction. First you need to find the direction, which you can achieve by doing subtracting character location from cube’s location and normalizing the result, like so :  
(Cube.GetActorLocation - Self.GetActorLocation) → GetSafeNormal

The result vector is a one-unit vector with a direction that points from character to cube. Multiply that by 150 and you have your offset. Subtract that offest from cube’s location and it should do the trick.

So in the end something like this :  
Cube.GetActorLocation - ((Cube.GetActorLocation - Self.GetActorLocation)-\>GetSafeNormal \* 150)

---

<div class="post-metadata">

**Author:** ![LuBuSniper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lubusniper/32/571326_2.png) [@LuBuSniper](https://forums.unrealengine.com/u/LuBuSniper)\
**Post date:** [March 21, 2025, 5:14pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104/3 "2025-03-21T17:14:34Z")

</div>

> [@Chatouille](#):
>
> GetActorLocation

[ViewCode](https://blueprintue.com/blueprint/zzuaekjp/)

didn’t work, idk what did i do wrong

---

<div class="post-metadata">

**Author:** ![LuBuSniper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lubusniper/32/571326_2.png) [@LuBuSniper](https://forums.unrealengine.com/u/LuBuSniper)\
**Post date:** [March 21, 2025, 5:18pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104/4 "2025-03-21T17:18:02Z")

</div>

ohhh i thank you so much, i should have subtracted the location. thnx soooooooooooooooooooooooooooo much

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 20, 2025, 5:19pm UTC](https://forums.unrealengine.com/t/150-units-away-from-the-target/2405104/5 "2025-04-20T17:19:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
