How do I make something move from A to B instantly?

Just started using Construct 2? Post your questions here

Post » Thu Jun 18, 2015 12:59 pm

How do I get an object to be in one place and then another instantly, like it is teleporting. For example if I get too close to the object, make it disappear and reappear in a new (set) location. This is quite urgent so a quick response would be very much appreciated.
B
4
Posts: 14
Reputation: 228

Post » Thu Jun 18, 2015 1:09 pm

Depends how you want to make it.

1. But you can either you is overlapping which will make you able to teleport the object as soon as they are overlapping each other.
2. Use a distance check to see if the objects are within a certain range. Distance(Obj1.X, Obj1.Y, Obj2.X, Obj2_Y) will give you the distance between two object, you can then check if this is lower than a certain value and act on that.

If you want to make it so it based on mouse you just switch one object with Mouse.X and Mouse.Y
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Thu Jun 18, 2015 1:14 pm

Sorry not quite what I was looking for, but I didnt explain myself very well. I mean could I go, say, +600 to Y axis and make it go there instantly, rather than a set coordinate with an X and Y value.
B
4
Posts: 14
Reputation: 228

Post » Thu Jun 18, 2015 1:26 pm

Instantly?

Object -> SetPosition(Self.X,Self.Y+600) ?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 3:13 pm

Maxwell002 wrote:Sorry not quite what I was looking for, but I didnt explain myself very well. I mean could I go, say, +600 to Y axis and make it go there instantly, rather than a set coordinate with an X and Y value.


Sorry not really sure what you mean? As Deathangel says you can just set the position and it will instantly go there as he have shown.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests