help with collision check to switch gravity

hello, I am trying to have gravity switch when the player is over specific tiles. I made a different tilemap on a different layer than my terrain so those tiles can work as like a background and tagged that as ‘shadowside.’
then wrote the code I’ve attached. (things like rotation and jumping I am saving for after the switch works at all)

currently the top half is filled with colored tiles I’ve put the tag and a trigger collider on and the bottom half is clear. when the player moves into the orange they drop very slowly to the clear side then drop like normal to ground. So the trigger is working but doesn’t stay triggered continually.

I also tried using a game object instead of the tiles but that had the same effect.

is there a different way to try this?

If I understand what you’re trying to say here, you want something to occur continuously while it is in the trigger? Perhaps you need the OnTriggerStay life cycle method? Unity - Scripting API: MonoBehaviour.OnTriggerStay2D(Collider2D)

1 Like

This sounded like exactly what I was trying but I was only using enter/exit. When I added OnTriggerStay2d- with the enter/exit ones it “pulls” the character to the ceiling before it is on the trigger then drops it the same way. When I try it with only the Stay and no exit/enter it slowly moves back and forth on its own.

OnTriggerStay2D try that