#how do make make the Transform.basis, be based on another object orientation?
1 messages · Page 1 of 1 (latest)
What I do for this is make a Node3D and call it Yaw. Then I add a child to Yaw called Pitch (also Node3D). Then I add a Camera3D as a child to Pitch.
Then, you set each transform to one of the axis' you care about.
Yaw gets rotated around Y and is moved to the target position every frame.
Pitch gets rotated around X and doesn't move positions.
Camera3D gets rotated around Z (roll... use this very very sparingly if at all) and moves backwards to zoom out, moves forwards to zoom in.
Distance on camera's local Z axis is the zoom level.
I've heard this called a "Crystal Ball Interface".
After this is setup, what I do is keep a global reference via an autoload to the cam_root object (the yaw obj) which has a script on it that has a variable "yaw" that is the direction you're facing. Set the player object to this before moving it and you've got a player that looks away from the camera always 🙂
not at all what i want
camera is spouse to be fully independent, standing mostly in place looking at player, maybe sometimes moving on a rail. (think, early resident evil)
and thats why there is a problem
cause i want to use the basis of some otehr object orientation, instead of the thing that is actualy moving
and its not refering to either parent or child node
its fereting to some other node in the scene
or like how mario 64 camera is bearly dependant on the mario, and yet forward is away from camera
Oh. Maybe try using an Area3D to switch your player and camera? When the player enters Area3D named "hallway" say it locks the player's angle to match the hallway and then just make the camera look_at the player
Use the area3d's forward direction even
thats not the problem, and rtegardless, i already fixed the actual problem
"move based on the camera perspective" is aparently too complex for some people to grasp
If you fixed the problem, you shouhld edit your post with the solution and mark it as "Solved". Also maybe actually explain your problem next time you want help
- I did explain it, "Move based on camera position" should be clear
- I thought I deleted this thread is whatever it's called
- that's not even what you said. You said "move based on the camera perspective" which doesn't make sense at all. the camera perspective has nothing to do with movement, it's for viewing the game. Moving based on the camera position would also be not very smart. You want to move the camera based on the players position, not vice versa in most cases.
- You didn't. Go ahead and mark it solved if it's solved