# How do I make a object hurt when hit in a specific way

Get help using Construct 2

### » Sun Jun 14, 2015 4:23 am

so i want to make a object only when it is hit in a specific way the specific way is

Hurt
||||||
||||||Safe

Safe
_______
_______ Hurt
_______

For those who did not understand i wnt the player to get hurt only when he hits the top of the object
B
5
S
1
Posts: 60
Reputation: 495

### » Sun Jun 14, 2015 7:40 am

Hey Ash,

you could compare the Y value of the object colliding when the event triggers, If the object is above a certain height then proceed with the action, if not then nothing will happen.
B
149
S
30
G
7
Posts: 1,103
Reputation: 14,477

### » Tue Jun 16, 2015 11:12 am

@GenkiGenga
Hang on i did not understand could you write down the events or put a capx pls
B
5
S
1
Posts: 60
Reputation: 495

### » Tue Jun 16, 2015 11:45 am

Give you a little hint, you know it from school, 5. year.

Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328

### » Tue Jun 16, 2015 2:19 pm

@deathangel1479 I think that made even less sense.

In mario, they would check if the player was falling. if they were you could assume they are hitting from the top.
B
48
S
15
G
8
Posts: 603
Reputation: 8,776

### » Tue Jun 16, 2015 2:25 pm

There is a much easier technique than all the maths above

Just use Overlapping with Offset. Suppose if sprite A is to be hit by sprite B from top. Then:

--------------------------------------------------------------------------
[A] On Collision with [B]
[A] is overlapping with [B] with offset (X: 0, Y: -2)
---------------------------------------------------------------------------

This way, once A gets collided with B, it will check 2 pixels above it if B is there or not.
B
13
S
3
Posts: 122
Reputation: 1,187

### » Tue Jun 16, 2015 8:12 pm

EncryptedCow wrote:@deathangel1479 I think that made even less sense.

In mario, they would check if the player was falling. if they were you could assume they are hitting from the top.

capx
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328