How do I drag an object vertically

Just started using Construct 2? Post your questions here

Post » Thu Apr 02, 2015 2:27 pm

Hello,

I want to make an object which can be moved by the user just vertically, but I want to specify max and min values for y.
B
3
Posts: 4
Reputation: 183

Post » Thu Apr 02, 2015 3:18 pm

The drag and drop behavior allows you to limit the axis upon which an object is dragged to strictly vertical -- this is found in the behavior properties. To limit the Y range, every tick you can set the Y position of your Sprite to something like the following:

clamp(Sprite.Y, LOWBOUND, HIGHBOUND)

LOWBOUND and HIGHBOUND being whatever you want to limit your min and max Y values to respectively.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,096

Post » Fri Apr 03, 2015 1:04 pm

worked great! Thank you very much :)
B
3
Posts: 4
Reputation: 183


Post » Thu Apr 09, 2015 11:57 am

Message: miketolsa is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Lordshiva1948 wrote:Learn more with demos:



Thanks for the quick reply could you please reupload the demo folder on dropbox again .....

as I am getting error while accessing it .....

The folder '/Demos' does not exist.
Image
B
36
S
13
G
1
Posts: 99
Reputation: 3,051




Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests