How do I make walls only affect enemies?

Get help using Construct 2

Post » Sat Dec 13, 2014 5:28 pm

I have invisible walls to keep my enemies patrolling on platform. However, my player can't pass through the invisible walls. How do I make it so that only me enemies are affected by invisible walls?
B
58
S
19
G
3
Posts: 445
Reputation: 6,300

Post » Sat Dec 13, 2014 5:33 pm

Do your invisible walls have the "solid" behavior? If so try disabling it. As far as I know your enemies should still do what you want them to.
B
5
S
1
Posts: 25
Reputation: 427

Post » Sat Dec 13, 2014 5:44 pm

@Sinon They do have solid behavior, but when I disable, they walk right through it.
B
58
S
19
G
3
Posts: 445
Reputation: 6,300

Post » Sat Dec 13, 2014 5:44 pm

@Sinon the enemies are also on Platform behavior with the 'next to wall' event to change patrol direction
B
58
S
19
G
3
Posts: 445
Reputation: 6,300

Post » Sat Dec 13, 2014 11:28 pm

I'm afraid i'm not a genius when it comes to construct 2 as i'm a newbie myself but have you tried giving your enemie the "sine" behaviour? you can make them move horizontally, you can also change the magnitude and period which controls their speed and distance.
B
5
S
1
Posts: 25
Reputation: 427

Post » Sun Dec 14, 2014 12:11 am

@jook00

Make the solid behavior disabled my default. Then when any enemy collide with this specific wall (UID) you activate it's solid behavior. But in order to work you need to create a second wall (both really thin) to do the same thing as the first one do. The second wall is needed because when you collide and activate the solid behavior, the enemy will pass trought it because the colision already hapened. After that, if the enemy is not overlapping the wall anymore, disable the solid behavior again.

You need to play with this and test many times to work properly.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Sun Dec 14, 2014 12:53 am

@kossglobal I think I understand the logic, but if the enemy touches the inside wall first, and made the second wall solid, then my player can't pass through it either.
B
58
S
19
G
3
Posts: 445
Reputation: 6,300

Post » Sun Dec 14, 2014 3:15 am

There are a number of ways you could do this. Sines are commonly used for this sort of thing. However, if you want to go the route of invisible barriers (they are more flexible), try this:

https://www.dropbox.com/s/xkd1uefwp8ffb ... .capx?dl=0
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to How do I....?

Who is online

Users browsing this forum: Eren, koops and 9 guests