How do I check if object is on top of specific platform?

Get help using Construct 2

Post » Tue Dec 09, 2014 2:02 pm

I need a condition that means platform object (player) is on top of a SPECIFIC INSTANCE of jumpthru object to make the player follow the angle of the jumpthru object.

There are MULTIPLE instances of the jumpthru object, each with DIFFERENT angles so I really need the condition that means player is stepping on a specific instance.

I only need the condition, I already know the action.

Already tried these (one at a time)
overlapping
collision
platform: is on floor

Any ideas I can try? Thanks in advance.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Tue Dec 09, 2014 2:59 pm

You can use a detector object. Make an invisible sprite, positioned above/on the platform. Then it's a matter of 'overlapping' and some instance variable providing the data you are looking for.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Dec 09, 2014 3:05 pm

,,,,,,,,,,,,,
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue Dec 09, 2014 3:34 pm

@blackhornet
thanks. that gave me another idea to use for another concept

@korbaach

thanks for giving a working example. But I want to learn it not just copy the codes. Can I ask a few questions?

1. How exactly does overlapping at offset works? I read description and I don't get it?
2. this expression
lerp(Sprite3.Angle,Sprite2.Var_angle,dt*20)
^I get that Var_angle. what is dt? I don't get what dt means.

dt
Return delta-time according to the object's own timescale. See Delta-time and framerate independence for more information.

description from
https://www.scirra.com/manual/126/system-expressions
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Tue Dec 09, 2014 4:17 pm

Overlapping at offset basically takes the collision polygon of your object, moves it according to the offset, and then checks for overlap.

With is you can check whether you're on top of a platform by moving the collision polygon down, causing overlap only if an object is beneath you.

deltatime is used to make operations framerate independant. To assure you check for collisions every 20ms, instead of every frame, which may vary (and miss collisions).
B
18
S
6
G
3
Posts: 30
Reputation: 4,208


Return to How do I....?

Who is online

Users browsing this forum: Phacanu and 10 guests