Another noob with camera troubles.
I’ve tried just about every suggestion I could Google, and none of them seem to work quite right. I fix one problem only to introduce a worse one.
I want to have a camera attached to a player spatial, and I want the camera to be able to look around in all directions, but only move in a flat plane, i.e., the camera’s Y axis position never changes, even though it looks up or down. Basic FPS camera.
In some other resources I read on the forum, it was suggested that BetterCharacterControl be used instead of CharacterControl. Problem is, the methods are different, and I can’t find an example showing what I want. There’s a BetterCharacterControl test/example, and I’ve looked through it about a dozen times. When the camera is locked to the character node, any vertical camera motion is disabled. It seems that the proper “FPS” camera examples are the HelloTerrain/Collision examples, among others, but they rely on a CharacterControl, and apparently the CharacterControl has physics issues.
I’ve tried many different varieties of nodes on nodes and different camera types. I’ve tried manually changing the camera’s rotations through various methods, but none of them work. I extended Camera and made my own, copying all of the FlyByCamera class and adding a line that stops any vertical motion, which works fine… except when I attach it to a spatial, and there’s no way to move it up to eye height. And to clarify, no, I didn’t remove the rise method, I told the move method to ignore any values from the camera direction vector that would make it go up. The rise method still works fine… until attached to a spatial. And apparently, I can’t set a node to follow above the spatial because I’m an idiot.
Sorry about the rambling. This is frustrating. And apparently, it seems that a lot of people struggle with the camera until they eventually write their own.
tl;dr;
Is there some code I can look at that uses BetterCharacterControl and a typical FPS style camera? The only examples I see are for CharacterControl, and the methods are different.