# Grab box problem

**URL:** <https://forums.unrealengine.com/t/grab-box-problem/2364772>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [February 28, 2025, 5:29pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772 "2025-02-28T17:29:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 5:29pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/1 "2025-02-28T17:29:36Z")

</div>

I am trying to make a system where I can grab a box with my mouse cursor. The box keeps snapping out of location from the cursor, and I can’t grab it with physics enabled. Please help!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 28, 2025, 5:35pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/2 "2025-02-28T17:35:53Z")

</div>

> [@Thressnoriynne](#):
>
> Please help!

Please post script! It might be the case of tracing against the box while you’re already holding it, which would create a crazy feedback loop. It might be another 10 things, too. 🤷

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 5:37pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/3 "2025-02-28T17:37:14Z")

</div>

This is my script for the box

 ![Problem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/0/640bebbe4ca3852ced9b5957ebed2b8073faa38e.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 28, 2025, 5:43pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/4 "2025-02-28T17:43:56Z")

</div>

Have a look at this post, there are examples of moving an actor with the mouse using a specific axis:

> [@Left Mouse button pressed and released equivalent in enhanced input (or drag and drop)](https://forums.unrealengine.com/t/left-mouse-button-pressed-and-released-equivalent-in-enhanced-input-or-drag-and-drop/1633884/18):
>
> Here’s some script allowing for picking up stuff and moving it in a specific plane only we determine ourselves manually: The green debug plane visualises what’s going on. In short: shoot a beam (trace) from the screen centre towards the projected mouse cursor, when it eventually intersects that plane (which is infinitely large), place the actor at the intersect world coordinate. If I change the normal: You could derive this Normal from the actor itself instead:

* * *

The script you’re showing seems to suffer from the issue I mentioned originally, you keep tracing against the component you’re already holding so the position keeps shifting.

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 5:54pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/5 "2025-02-28T17:54:57Z")

</div>

How do I get this node?

 ![Is_valid_node](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/5/9e5a0cde5e2c1a58a918416255a5be64bc7cbbe7.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 28, 2025, 5:56pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/6 "2025-02-28T17:56:31Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/9/ff93d27f308d5023464963dbb02ced2d3763c1ce.png)

Right click any object reference variable to validate it. It does the same as the two nodes below.

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 5:57pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/7 "2025-02-28T17:57:05Z")

</div>

Got it! Thanks!

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 5:57pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/8 "2025-02-28T17:57:35Z")

</div>

And one more thing, what variable is the actor to move?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 28, 2025, 6:08pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/9 "2025-02-28T18:08:04Z")

</div>

`Actor`, you can easily create variables of the appropriate type with right click promotion:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/4/104e64b3130b414e5f8b5e8098e01eaea256a649.png)

Fewer clicks = fewer chances for the carpal tunnel syndrome 😇

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 6:11pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/10 "2025-02-28T18:11:42Z")

</div>

Thanks for the help. I just got it working, and wit’s working quite nicely. 🙂

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [February 28, 2025, 8:55pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/11 "2025-02-28T20:55:52Z")

</div>

After this, how do I get it so that the box can’t move through other static meshes in the world?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 28, 2025, 9:16pm UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/12 "2025-02-28T21:16:11Z")

</div>

Enable Sweep on the Set Actor Location node.

---

<div class="post-metadata">

**Author:** ![Thressnoriynne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thressnoriynne](https://forums.unrealengine.com/u/Thressnoriynne)\
**Post date:** [March 1, 2025, 12:48am UTC](https://forums.unrealengine.com/t/grab-box-problem/2364772/13 "2025-03-01T00:48:32Z")

</div>

Alrighty! Thanks a million!
