(Solved)Help with mouse input for third person game #246
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@ramokz Sorry about the later post. I tried to close this one, thinking it would be better than following it up, but I found out I couldn't after creating the second one. Using the third-person example scene, I set the mouse input to move the camera around with some reverse engineering and make my character face whatever the camera was looking at, but I couldn't make it face left, right, or back. How can I implement that in my script? I tried to use look_at "$%Character.look_at(global_transform.origin + direction, Vector3.UP)", but the character faces the opposite side of the Input (ex: left if I pressed right) for a split of a second. It then never faces any direction again, just facing where the camera looks at.
|
Beta Was this translation helpful? Give feedback.
If I understand it correctly, you essentially want to make the character turn towards the direction you've moving the character in? E.g. if you make your character go left, the character model should also be turning left?
Think what you're looking for isn't a
look_at()
solution, but rather arotation
setter, where you set the rotation of the character relative to the camera's rotation and based on the direction you press. The currentlook_at()
approach doesn't seem to take that into account?Though since this sounds more like a general code question, rather than specific to this addon, so you will likely get a better answer on dedicated game dev / Godot forums or channels. Will also likel…