Drag And Drop Object Speed ?

Get help using Construct 2

Post » Mon Jan 23, 2017 10:39 am

is it possible to make an object move at custom speed while dragging it ? like when you drag it.. there is a delay.. not going direct to mouse or is there any other way to do it ?
B
8
S
4
Posts: 46
Reputation: 858

Post » Mon Jan 23, 2017 10:49 am

To achieve this I think you'd have to have two separate objects. One object would have the drag and drop behaviour, the other object should be given a basic steering behaviour to ensure it always moves towards the other.
Something like Move x pixels at angle(Self.X,Self.Y,DragDrop.X,DragDrop.Y)
<iframe frameborder="0" src="https://itch.io/embed/146124?linkback=true&dark=true" width="552" height="167"></iframe>
B
26
S
7
Posts: 254
Reputation: 2,389

Post » Mon Jan 23, 2017 11:08 am

Steering Behavior ??
B
8
S
4
Posts: 46
Reputation: 858

Post » Mon Jan 23, 2017 12:03 pm

Yeah, like the example given. A steering behaviour is a generic term for a behaviour that causes one thing to move in the direction of (or away from the direction of) another object. The simplest example in Construct 2 is using the 'Move at angle' action using the angle between the two objects.
<iframe frameborder="0" src="https://itch.io/embed/146124?linkback=true&dark=true" width="552" height="167"></iframe>
B
26
S
7
Posts: 254
Reputation: 2,389

Post » Mon Jan 23, 2017 12:23 pm

There's a CapX here if you want it, with a few little refinements and notes.

https://drive.google.com/open?id=0Bwizs ... 2FXaGlNbWc
<iframe frameborder="0" src="https://itch.io/embed/146124?linkback=true&dark=true" width="552" height="167"></iframe>
B
26
S
7
Posts: 254
Reputation: 2,389


Return to How do I....?

Who is online

Users browsing this forum: stellko and 3 guests