you want my noodles? okay. fits in one screen. it’s all “hardcoded” rn, but the core principle is just that.
essentially…
when you leave (end overlap) a planet (trigger sphere around it) you change the material to the space variant with the point light shader and disable gravity.
when you enter a planet (begin overlap) you change the material to the world (with directional light) compute the gravitiy vector and enable gravity.
the computation of the directional light vector could essentially be put into the player tick function or you compute it on entry (begin overlap) and point it at the planet. this is a piece of code you could recycle as a function. just give it the location input. if the sun was somewhere else you just do the math with this location. in this case you’d have to feed the sun location into the space material tho and compute a subtraction instead of the 1-x i did for simplicty.
