## How do I get my plane to move in a linear fashion?

It’s a top down game, I’ve added the Linear movement behaviour but nothing works, when I apply a force it doesn’t move in a straight line.

## What is the expected result?

When I click with the mouse, the plane should move linearly (in a straight line) towards the cursor coordinates. If I click somewhere else along the way, it should do the same from its current position.

## What is the current result?

The plane moves towards the cursor coordinates but is not at all precise, so it misses the coordinates, so it turns around, etc…

Thanks for your help

Hi - paste here your code. Problem might be, that you are using X nad Y coords, but some actions (such as move to position) using CenterX and CenterY - that can be one of the problems. But best would be to paste your code here.

First I would recommend to use Trigger once for the mouse clicking condition.

And I think the problem realy is, that in gdev the coordinates are not integers - they are float, so you can get number for X coordinate like 401.0000034 and then to match it in the next condition could be realy very difficult.

So in that case I would recommend to use Collision or Distance between two objects condition - that may work better.

By using interpolation with a formula that divides the distance between 2 points by the speed (a random number to have a reference point) to always have the object moving at the same speed regardless of the length of the path. This speed is stored in a variable so that it can be modified if necessary.

Thanks for your help, it works well with Interpolation.