# Click To Move

The Click To Move component is for games with a top down view and mouse controls, allowing you to click a location on the map to set a target position, and then the rotorcraft will make its way to that target position.

This component does not do any path finding, if an obstacle is in the way the rotorcraft will hit it.

The Click To Move component can be used along side a normal input control component (WASD for example), however, using WASD whilst the rotorcraft is heading towards a target will result in unwanted movement - as the rotorcraft will continue to move to the target position until it reaches it, using other input does not cancel this movement.

![](/files/-Miwj3C6-PFTYRJQRdR7)

**Target Visual** - Assign a Transform for the visual you wish to place on the ground where the player clicked. This can be left empty.

**Camera** - This class uses *ScreenPointToRay()* and requires a camera to do so, if this field is left empty the class will cache and use *Camera.main.* There is a public property available for you to set this field at runtime.

**Min Distance To Move** - How far away a new target position needs to be from the rotorcraft, before it will move.

**Min Angle To Turn** - What is the minimum angle required between the front of the rotorcraft and the target position, before the rotorcraft will turn. Setting this too low will result in wobbly/ shakey movement as the rotorcraft heads towards the target position.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arcdocs.enigma23.co.uk/how-to/click-to-move.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
