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?
The bullets will go through any solid object if you just set the "Bounce off solids option to No".
Unfortunately I am using bouncing bullets and would still like them to bounce off normal walls!
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.
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.
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.
try this demo change it around and see
Develop games in your browser. Powerful, performant & highly capable.
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!