How do you make semi solids?

this is something I want to implement into my Super Mario Bros 3 Remake thats staring development soon

What do you mean by semi-solid? How would it act?

when you jump, the player goes through it, it becomes solid when that player lands on it

So essentially it’s solid from the top but passthrough-able from the bottom

@GBchangeling
One way of doing this would be to use a disable/enable behavior on the actual block and check whether the player is above the block or beneath it. I put some code together that works in the way you said in your comment. You can take a look at it or copy and paste it into a game and try it out. However, it does disable the block. Which means if you wanted to have enemies walking on top of it, they would also fall through unless the player was on it. If that is a problem, you could try using similar code to this on the player instead of the block, although I’m not entirely sure how that would work. There also might be other ways of doing this, but this is what I came up with.

Here is the code I played with:

Image:

Copy/paste:

{“data”:{“behavior”:{“v”:“2”,“nodes”:[{“inputCount”:2,“outputCount”:2,“name”:“Enabled”,“behaviorType”:“logic.properties.Enabled”,“x”:1350,“y”:288,“group”:"",“id”:“acb0f279094e5944”},{“inputCount”:1,“outputCount”:1,“name”:“Extractor”,“behaviorType”:“logic.properties.Extractor”,“x”:540,“y”:288,“group”:"",“id”:“acc1e03fff20bf40”,“targetId”:0,“prop”:“y”},{“inputCount”:1,“outputCount”:1,“name”:“Extractor”,“behaviorType”:“logic.properties.Extractor”,“x”:540,“y”:384,“group”:"",“id”:“acc1f4e9290f664c”,“targetId”:95638449,“prop”:“y”},{“inputCount”:0,“outputCount”:1,“name”:“Always”,“behaviorType”:“logic.triggers.Always”,“x”:360,“y”:288,“group”:"",“id”:“acc23fc5da861741”},{“gateVal”:0,“mode”:“greater than”,“inputCount”:2,“outputCount”:2,“name”:“Filter”,“behaviorType”:“logic.logic.Filter”,“x”:1080,“y”:288,“group”:"",“id”:“acc25e611b45df4a”},{“expression”:“A-16”,“default0”:0,“default1”:0,“tag”:"",“inputCount”:3,“outputCount”:1,“name”:“Expression”,“behaviorType”:“logic.logic.Expression”,“x”:720,“y”:288,“group”:"",“id”:“acc3ccc3bdfdca42”},{“inputCount”:0,“outputCount”:1,“name”:“Always”,“behaviorType”:“logic.triggers.Always”,“x”:540,“y”:160,“group”:"",“id”:“acc45880d090d948”},{“expression”:“A+7”,“default0”:0,“default1”:0,“tag”:"",“inputCount”:3,“outputCount”:1,“name”:“Expression”,“behaviorType”:“logic.logic.Expression”,“x”:720,“y”:416,“group”:"",“id”:“acc69f934d92b141”}],“links”:[{“input_id”:“acb0f279094e5944i0”,“output_id”:“acc25e611b45df4ao1”},{“input_id”:“acb0f279094e5944i1”,“output_id”:“acc25e611b45df4ao0”},{“input_id”:“acc1e03fff20bf40i0”,“output_id”:“acc23fc5da861741o0”},{“input_id”:“acc3ccc3bdfdca42i0”,“output_id”:“acc1e03fff20bf40o0”},{“input_id”:“acc1f4e9290f664ci0”,“output_id”:“acc23fc5da861741o0”},{“input_id”:“acc69f934d92b141i0”,“output_id”:“acc1f4e9290f664co0”},{“input_id”:“acc1e03fff20bf40i0”,“output_id”:“acc23fc5da861741o0”},{“input_id”:“acc1f4e9290f664ci0”,“output_id”:“acc23fc5da861741o0”},{“input_id”:“acc25e611b45df4ai0”,“output_id”:“acc69f934d92b141o0”},{“input_id”:“acc25e611b45df4ai1”,“output_id”:“acc3ccc3bdfdca42o0”},{“input_id”:“acc3ccc3bdfdca42i0”,“output_id”:“acc1e03fff20bf40o0”},{“input_id”:“acc3ccc3bdfdca42i2”,“output_id”:“acc45880d090d948o0”},{“input_id”:“acc25e611b45df4ai1”,“output_id”:“acc3ccc3bdfdca42o0”},{“input_id”:“acc3ccc3bdfdca42i2”,“output_id”:“acc45880d090d948o0”},{“input_id”:“acc69f934d92b141i2”,“output_id”:“acc45880d090d948o0”},{“input_id”:“acc69f934d92b141i0”,“output_id”:“acc1f4e9290f664co0”},{“input_id”:“acc69f934d92b141i2”,“output_id”:“acc45880d090d948o0”},{“input_id”:“acc25e611b45df4ai0”,“output_id”:“acc69f934d92b141o0”}]}}}

2 Likes

Nice explanation @johnpost, like the extra effort of adding all the notes.

Another option would be raycasting as @JR01 did in his Raycast World example.
Have a look at the code of those blue platforms.

2 Likes

@GBchangeling make sure to check out what @TinkerSmith posted. I really don’t use the raycast behavior despite using flowlab a lot (oops, I should probably look into it, it seems quite powerful). The blue platforms seem like they might be what you want.

EDIT: Looking at that code, I think mine and it would behave essentially the same, it is up to you which one is easier/fits your game better. A problem I could see possibly arising with both ways is the fact that the block is disabled completely, meaning anything with gravity will go through it unless the player is standing on it. You will have to keep that in mind when coding enemy movement.

1 Like

I have a “Semisolid Platform” example that is easier to use.
The example has several options to use, including that Raycast Platform.

2 Likes