I’m new to the Unity interface and I’ve been working in 2D to create a demo for a game that includes being able to rotate the gravity field of the player. Basically the player has the option to rotate in 90 degree increments with the L/R buttons on the controller (like the game “And Yet it Moves”) and gravity is relative to which direction the sprite is facing. The player can jump and I’m looking for a way to set a ground check position.
Trig will work, but I’m wondering if there’s some other way that Unity can handle the situation. I drew a little picture:
I imagine that people making side-scrolling snowboarding games run into something similar. Setting the gC position to the parent’s transform.position.y - 3f or something like that doesn’t allow it to rotate freely with the parent. My idea right now is to get the angle via eulerAngles.w and draw up an equation that will give me the offset x and y components and I can set this gC point relative to the parent’s transform.
Is there an easier way to do this or is it soh cah toa time?