I apologize if this is a bad question.
Is there a method for making my velocity adjust to locally based? My aim is to enable my character to move and jump within a rotated Node referred to as "Container." I did not alter my player scene's position or rotation. Since my player's transform was not influenced by the Container Node, I assumed the velocity would not be either. However, the velocity disrupts the movement entirely, causing my player to fall downward instead of toward the platform, as the velocity has its own directions. How can I modify my velocity to align with the corresponding position? I am using the default CharacterBody3D basic movement. Greatly appreciate any help!

  • It seems like you want to adjust gravity so that your character will fall towards the "Floor" and move parallel to it. Is that correct?

    You don't need your Player or your Floor to be children of the container. I would actually suggest against that.

    First you need to adjust gravity. That isn't hard to do! Add an Area3D volume, and then follow this guide for giving it a gravity vector. That way, when your character is in that area, they will fall the way your vector points.

    Then, you need to worry about making your player move orthogonally to your gravity. Change your CharacterBody3D.up_direction to be opposite gravity. In your movement controls you will need to rotate the movement vectors from your Inputs. I don't think there is a premade way to do that, although I could be wrong. To do it manually, first create a Quaternion. It might be easiest to use the Floor's transform as your basis. That would look something like var quat := Quaternion(floor.transform.basis).normalized(). Then you'll need to use that Quaternion to rotate your Vector3s via multiplication. var rotated_vector := quat * original_vector

    There's more to it of course, but you'll need to figure it out as you go. It's definitely a lot to deal with, but that's what you get for trying to recreate Super Mario Galaxy 😉

It seems like you want to adjust gravity so that your character will fall towards the "Floor" and move parallel to it. Is that correct?

You don't need your Player or your Floor to be children of the container. I would actually suggest against that.

First you need to adjust gravity. That isn't hard to do! Add an Area3D volume, and then follow this guide for giving it a gravity vector. That way, when your character is in that area, they will fall the way your vector points.

Then, you need to worry about making your player move orthogonally to your gravity. Change your CharacterBody3D.up_direction to be opposite gravity. In your movement controls you will need to rotate the movement vectors from your Inputs. I don't think there is a premade way to do that, although I could be wrong. To do it manually, first create a Quaternion. It might be easiest to use the Floor's transform as your basis. That would look something like var quat := Quaternion(floor.transform.basis).normalized(). Then you'll need to use that Quaternion to rotate your Vector3s via multiplication. var rotated_vector := quat * original_vector

There's more to it of course, but you'll need to figure it out as you go. It's definitely a lot to deal with, but that's what you get for trying to recreate Super Mario Galaxy 😉