How do I Set Position To Object Instance

Just started using Construct 2? Post your questions here

Post » Wed Jan 28, 2015 1:57 am

So, I have a bunch of jump-thru platforms. I have several objects other than the player using the "fall-thru" function, which is why I am using jump thru. Lots of stuff falling through. Anyway, it seems like, if something is falling through a platform right as the player lands on one, the player also falls through that platform. I tried doing ON LANDED, SET POSITION TO PLATFORM.Y to prevent this, but that sets the players position to the platform instance with the lowest UID. How can I tell it to set the players position to the Y of the platform INSTANCE?
B
12
S
3
Posts: 43
Reputation: 1,213

Post » Wed Jan 28, 2015 2:33 pm

I think if you say that "If Player is overlapping Platform" it automatically chooses this instance of Platform for the event so you would only have to say your set to Platform thing i think
B
3
Posts: 6
Reputation: 187

Post » Wed Jan 28, 2015 8:41 pm

I was really hoping that would work, but it did not. Pulling my hair out trying to figure out a workaround.
B
12
S
3
Posts: 43
Reputation: 1,213

Post » Wed Jan 28, 2015 8:54 pm

do you tried picking the object with its UID?
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Wed Jan 28, 2015 9:06 pm

There's a picking option called nearest and furthest. Picking the nearest platform to the character should work.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Wed Jan 28, 2015 9:19 pm

EyeForcz wrote:do you tried picking the object with its UID?

Burvey wrote:There's a picking option called nearest and furthest. Picking the nearest platform to the character should work.


I feel bad, but I dont really know how to use either of those.

For the pick nearest, I tried the following and got all kinds of crazy warping around the layout. I did, PLAYERBOX > ON PLATFORM LANDED, then made a sub event that said PLATFORM > PICK NEAREST TO PLAYERBOX.X, PLAYERBOX.Y and the action for that sub event said SET POSTION TO PLAYERBOX.X, PLATFORM.Y. That doesn't seem too well.

I don't even know how I would go about telling the UID idea to work.
B
12
S
3
Posts: 43
Reputation: 1,213

Post » Thu Jan 29, 2015 12:05 am

Actually, I'm not sure how you have your events set up but it might be easier and less clunky if you just add some kind of condition to your events where the enemy can only fall through the platform if the player is X distance away.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Thu Jan 29, 2015 1:03 pm

Will give it a shot. Thanks!
B
12
S
3
Posts: 43
Reputation: 1,213

Post » Fri Jan 30, 2015 11:20 pm

That didn't seem to do it either. I really do think this to be a bug in the engine itself. I did find a workaround though. Make an object 1 pixel below the bottom of the platform pixel, and say IF PLAYER IS OVERLAPPING THIS OBJECT, SET PLAYER.Y TO OBJECT.Y. Its not perfect, but it makes the whole "sinking through the platform" deal not noticeable.
B
12
S
3
Posts: 43
Reputation: 1,213


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests