# Moving actor using mouse at specific Z at runtime

**URL:** <https://forums.unrealengine.com/t/moving-actor-using-mouse-at-specific-z-at-runtime/666754>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [October 11, 2022, 12:56am UTC](https://forums.unrealengine.com/t/moving-actor-using-mouse-at-specific-z-at-runtime/666754 "2022-10-11T00:56:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apleplectic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/apleplectic/32/579872_2.png) [@Apleplectic](https://forums.unrealengine.com/u/Apleplectic)\
**Post date:** [October 11, 2022, 12:56am UTC](https://forums.unrealengine.com/t/moving-actor-using-mouse-at-specific-z-at-runtime/666754/1 "2022-10-11T00:56:58Z")

</div>

I have no clue how to do this. Basically, I want to be able to move the actor along a specific Z value using the mouse - I am making a Tower Defense game, and I need to be able to move the actors along the flat landscape. I don’t really know how Convert Mouse Location To World Space works, nor do I understand dot products or line traces work. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [October 11, 2022, 1:31am UTC](https://forums.unrealengine.com/t/moving-actor-using-mouse-at-specific-z-at-runtime/666754/2 "2022-10-11T01:31:38Z")

</div>

Hey Aplepectic! Welcome to the forums!

Don’t worry, you won’t have to use Convert Mouse Location to World Space!

Firstly let’s set up your input!

Go to your main UE page and click “Edit”, and go to Project Settings.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/2/292a04044428dac63bec2f301b2267861126f27e.png)

Create a new Axis mapping with the + Symbol, and give it an input of mouse Y.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/e/cae2b45f95a889457a28edc42fe22fd954574d09.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/7/e372948ef200d77aa7781c82383aff4e90edfd63.png)

Next go to your player pawn and add this code. You’ll right click and search for whatever you named your input for Mouse Y to get the event.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/8/068aa72b227311d74d1058ecae579dba973818b4.png)

That _Multiply float \* float_ Node is really important because otherwise you’ll move centimeters with a full mouse movement. Hope this helped! Let us know how it goes!

---

<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:** [October 11, 2022, 9:12am UTC](https://forums.unrealengine.com/t/moving-actor-using-mouse-at-specific-z-at-runtime/666754/3 "2022-10-11T09:12:47Z")

</div>

> [@Apleplectic](#):
>
> I don’t really know how Convert Mouse Location To World Space works, nor do I understand dot products or line traces work. Thanks for the help!

You will need it sooner rather than later - I’d dig into it right now if I were you. But you can also do this for something truly simplistic:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/3/6e3470562acb5e7aaba030662b51724220f12935.png)

Just make sure the actor does not block Visiblity:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/1/09140a8724339e48670729cc38cbd2a98b00e67c.png)
