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

0 favourites
  • 5 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • 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.

  • 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.

  • ,,,,,,,,,,,,,

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)