can i acctually do this?

its going to be hard to explain tho…
if my player jump and hit lets say a platform, than it will stop getting higher and fall down.
what i want to do is when the player is jumping and is under the platform, to be able to pass through it. and only stay on it after he touched it on the top face.
i hav attached a pic i hope it explains…
i have tried a plane (because when you look it from the back it doesnt render) but it didnt worked.
thanks.

build the platform 2 pieced:

  1. box collider at the top of the platform, thats where you stand on
  2. a real trigger box below it that covers the whole platform too (up to the same height as the collider: as long as you are within the trigger, disable the game object that has the “top box collider”, once you leave it, enable that go to enable the collision

It doesnt work well…
any other solutions?

I do it with the plane. It works well for my game.

You could make a single object with a Collider Is Trigger. Always make a Raycast from the player, looking for a collider under the player. If it found one, put it in Is Trigger Off. When the collider found change during time, put the previous collider back to Is Trigger On.

when i jump through a plane it get stuck in the middle and when im on a plane it acts wierd…

The old nintendo Super Mash Bros 64 did this, so there’s a way if a crappier game maker did it.

Make sure that the collider is just on the top of the platform, so you won’t get a positive check result half-way through. Maybe make it like a plane.

can this work?
when i jump and im still getting higher - the platforms will be trigger
but when im getting lower - the platforms will be untriggered.
im not sure i know how to tho…

What if you made it so any collides below the players feet were visible (able to effect the player) and any above that point were invisible. So you’d be able to walk on things as normal, and when you jumped, you’d be able to go through them, even part way, unless your player feet got higher than them, which would then turn them on for the player, making it a solid platform to walk on like others below the player.

Naturally this should be done to only effect the player not the enemies.

Make your platform a one-sided mesh-collider (try it with the built-in plane)

i already tried it, it makes my player get stuck in the middle of the plane when im jumping threw it and when im walking on it, it just makes my player walk strange, my player is running with a rigidbody tho.

You could just keep track of what the Y coordinate of the player was in the previous frame and compare it to the current frame after physics, and if Y is further down the screen then allow the collision with the surface box to occur (ie clamp to the surface), otherwise pass through.

You could try making a plane and setting it on top, then making a box with no collider under it so it looks like a platform.

Sorry, noob here, just thinking aloud :wink:

thanks but as i said, plane makes my player get stuck when i try to jump through it and when i walk on it, my player walk wierd.

i dont think i know how to do it tho im noob in scripting (Brain exploads).

A useful trick to learning that, is to look at other scripts which do similar things but separately, see how they work and then put them together to create the one you need.

For example, a script that changes the fog effect if you go under a surface, to give the impression of being underwater. That would use something similar to what’s mentioned above. Then another script that turns collision boxes on or off would fill in the rest. Then it’s just a case of putting the two pieces from each together.

That’s what I try to do while I’m learning, it helps with understanding how it all works, without requiring you to jump into the deep end.

Hope that helps!

thanks yeah, im doing that too sometimes but i cant find script like that tho…