#how do make make the Transform.basis, be based on another object orientation?

1 messages · Page 1 of 1 (latest)

shadow raft
#

Im trying to make a derached 3rd person camera, and i want the player to move based on the camera perspective

next quarry
#

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 🙂

shadow raft
#

not at all what i want

shadow raft
#

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

next quarry
#

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

shadow raft
#

"move based on the camera perspective" is aparently too complex for some people to grasp

topaz turtle
shadow raft
#
  1. I did explain it, "Move based on camera position" should be clear
  2. I thought I deleted this thread is whatever it's called
topaz turtle
# shadow raft 1. I did explain it, "Move based on camera position" should be clear 2. I thoug...
  1. 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.
  2. You didn't. Go ahead and mark it solved if it's solved