# Problem: platform objects overlapping with solids

Get help using Construct 2

### » Sun Jun 15, 2014 11:06 am

So I have different heights of floors (like stairs) and when I punch enemy, enemy is supposed to be moving backwards by a set speed for a second's duration. Problem is, when the enemy (while moving backwards after being punched) is overlapping a solid (floor object), the enemy "teleports" to another place.

I understand why it happens. Platform-behavior characters can't overlap solid objects.

I want to ask what is a possible way to prevent this? Thanks.
B
16
S
7
Posts: 301
Reputation: 2,746

### » Sun Jun 15, 2014 2:24 pm

anyone help?
B
16
S
7
Posts: 301
Reputation: 2,746

### » Sun Jun 15, 2014 4:10 pm

I don't get it... Can you post a simple capx that contains the basic functions and the problem..?
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

### » Sun Jun 15, 2014 10:34 pm

@eli0s

I can only describe this problem like this picture

http://oi62.tinypic.com/2sb64c3.jpg

Hero and Enemy both have platform behavior.
gray boxes are solid floor objects
blue arrow - velocity of enemy being pushed towards solid
green arrow means the hero punches the enemy
The others are already listed in the picture

Bro, I remember you. You helped me before. Can you help me also here?
platform-char-same-angle-as-diagonal-floor_t108404
this is the picture explanation
http://oi59.tinypic.com/2utqbgy.jpg
condition for this is of course when player character is overlapping solid object
B
16
S
7
Posts: 301
Reputation: 2,746

### » Mon Jun 16, 2014 12:00 am

So how do you exacly move an enemy? By changing its position?

If it has platform behavior, try using "Add Vector X" function. This way it will recognize collision with a wall and stop it.
B
4
S
1
Posts: 4
Reputation: 360

### » Mon Jun 16, 2014 12:23 am

Hello! I tried to tackle both issues in the following capx. Please note that the steeper the angle of the floor, the more likely is to get "artifacts". Also, since I don't really understand how do you want to move the Enemy, I used 2 similar ways (the one is disabled, just enable it and disable the other which is active), and added a few stuff as a bonus Play with the values to get the result you are after.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379