# Topdown template using the movement controls

**URL:** <https://forums.unrealengine.com/t/topdown-template-using-the-movement-controls/370778>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 17, 2016, 12:26pm UTC](https://forums.unrealengine.com/t/topdown-template-using-the-movement-controls/370778 "2016-09-17T12:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rebel\_Camp\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rebel\_Camp\_Games](https://forums.unrealengine.com/u/Rebel_Camp_Games)\
**Post date:** [September 17, 2016, 12:26pm UTC](https://forums.unrealengine.com/t/topdown-template-using-the-movement-controls/370778/1 "2016-09-17T12:26:12Z")

</div>

Hi,

I don’t understand how the movement from the topdown template in blueprints works.

I’m trying to:

- rotate the player in the direction of the monster, when attacking
- if out of range to attack, first move the player towards the monster, or moving towards an interactable object when clicked

there is a “click and go there” section in the TopDownController blueprint but I don’t know how to call it, and I also don’t know how the topdown template rotates it’s player towards the mouse, so I can re-use that to rotate my player towards a monster when attacking or rotate and move towards an interactable object.

any ideas?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Rebel\_Camp\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rebel\_Camp\_Games](https://forums.unrealengine.com/u/Rebel_Camp_Games)\
**Post date:** [September 21, 2016, 8:36am UTC](https://forums.unrealengine.com/t/topdown-template-using-the-movement-controls/370778/2 "2016-09-21T08:36:43Z")

</div>

I figured it out. I ended up writing my own code entirely instead of trying to re-use the logic of the topdown template. There was no way to call the function, it just does Move to Hit Location when pressing the left mouse button.

So I wrote a complex code with distance checks, target tag checks etc… to handle movement, and then I added rotating towards the target when attacking.

The code of rotating towards the target can be seen in the added screenshot. The code for movement is too complex to post a screenshot about. Hope this helps other people as well.

 ![107920-rotation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/c/25ce6a6212e8be2af61c43eb561bc1b57562ac7f.png)

---

<div class="post-metadata">

**Author:** ![AdmiralZheng](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AdmiralZheng](https://forums.unrealengine.com/u/AdmiralZheng)\
**Post date:** [June 11, 2020, 10:41am UTC](https://forums.unrealengine.com/t/topdown-template-using-the-movement-controls/370778/3 "2020-06-11T10:41:16Z")

</div>

Can you post the full BP of this, i’m having the same problem, the character can move to target but need one more click to performe attack animation.
