How do I move along a rail with touch?

Get help using Construct 2

Post » Fri May 22, 2015 3:14 pm

I want to be able to drag and drop an object across a rail, but have it stop at the ends of the rail.
Any tips would be appreciated on the most simple way to go about this.
B
5
Posts: 37
Reputation: 299

Post » Fri May 22, 2015 3:44 pm

There are many ways,
one way is to 'drop' the sprite after it collides with ....
Image
B
35
S
10
G
4
Posts: 250
Reputation: 7,908

Post » Fri May 22, 2015 5:11 pm

I tried this, but I don't want the object to be dropped, and this way also doesn't stop from letting the sprite go over the area.
I appreciate it, but any other ideas?
B
5
Posts: 37
Reputation: 299

Post » Fri May 22, 2015 6:43 pm

I am sure there is a better way, for the master coders out there.....
but
try this:
Sprite = Player
Sprite2 = rail
I gave both the solid behavior.
Player has the drag and drop behavior
and it seems to work better with the Player having the Platform behaviour too.
( all the Platform options 0'd )
.....with the following code:
the sprite never penetrates ( never overlaps the rail )
Image

the order you make the code is important, Event 1 needs to stay at the top
2 and 3 can be swapped ,
play with it to see what works best for you.
Last edited by producermark11 on Sat May 23, 2015 12:12 am, edited 1 time in total.
B
35
S
10
G
4
Posts: 250
Reputation: 7,908

Post » Fri May 22, 2015 11:48 pm

Awesome, you rock! I will give this a try shortly!
B
5
Posts: 37
Reputation: 299


Return to How do I....?

Who is online

Users browsing this forum: NN81, plinkie, TsubaRu and 9 guests