How do I make an object solid to some,but passable by others

Get help using Construct 2

Post » Wed Jan 21, 2015 3:50 pm

I have a game where the player can move around with the arrow keys and shoot bullets with the mouse button.

I want to create a special kind of wall that the player cannot walk through, but the bullet can.

Any tips?
B
4
Posts: 22
Reputation: 244

Post » Thu Jan 22, 2015 12:28 am

The bullets will go through any solid object if you just set the "Bounce off solids option to No".
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Jan 22, 2015 10:30 am

Unfortunately I am using bouncing bullets and would still like them to bounce off normal walls!
B
4
Posts: 22
Reputation: 244

Post » Thu Jan 22, 2015 3:12 pm

If you want to go a a roundabout way of doing this, you can double up on the Physics and the Solid behavior; shoot-through walls will just have physics + immovable + no rotate, but regular walls will have that and Solid together. You won't be able to just use 8-direction for your player, though; to get it to react properly to physics objects, it will need to move by its physics behaviors.
Last edited by Unnatural20 on Thu Jan 22, 2015 3:40 pm, edited 1 time in total.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Jan 22, 2015 3:24 pm

Here's an example I put together. The controls aren't a perfect match for 8-directional, but with a little tweaking you might get movement like what you want.
You do not have the required permissions to view the files attached to this post.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Jan 22, 2015 3:41 pm

Of course, the simpler solution is this: Make both types of walls Solid, disable "bounce off of solid objects" on the bullet, and add a condition:
Bullet -> On Collision with SolidWall | Bullet -> Bounce Bullet off SolidWall.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Jan 22, 2015 7:58 pm

try this demo change it around and see
You do not have the required permissions to view the files attached to this post.
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,753

Post » Fri Jan 23, 2015 11:53 am

Unnatural20 wrote:Of course, the simpler solution is this: Make both types of walls Solid, disable "bounce off of solid objects" on the bullet, and add a condition:
Bullet -> On Collision with SolidWall | Bullet -> Bounce Bullet off SolidWall.


Hi just wanted to let you know I ultimately ended up doing this and it works great, thanks!
B
4
Posts: 22
Reputation: 244


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests