AttachCameraToBone() help...
Posted: Thu Aug 25, 2005 7:14 am
ok i want to use the AttachCameraToBone() command to make a scripted 3rd person player. i tried it and it seemed to work just fine (except for a bad offset of the yaw), but i noticed that i couldnt look left to right, only up and down (im VERY new to RF scripting). So i finally figured out that i had to put:
self.ideal_yaw=self.player_yaw;
ChangeYaw();
So when i go to see if my player can turn left to right, something very buggy happens. I move the mouse right, the player and camera start to turn right, then after about 70 degrees of turning, the camera starts turning left (while i keep trying to turn right), then after about 100 degrees of turning left the camera goes back to turning right (this is all happening when im trying to turn right with the mouse) . The camera seems to turn the other way only when im facing a certain direction.
After a while of testing, i think the problem lies in the fact that the camera was in first person mode (F1), but my scripted player was in "third person mode" (via the AttachCameraToBone() function). I think this is where the problem lies because i tried using the AttachCamera() function instead of AttachCameraToBone() and in first person mode the camera would rotate normally (which makes sense because the view was "first person", as in the eyes of the pawn). I know i should be in third person mode (F3) but the AttachCameraToBone() function doesn't seem to work in third person mode . Like when i use the AttachCameraToBone() function in third person mode (F3), the camera isnt attached to the the bone i specified, its just attached to the pawn like it would be if i used AttachCamera().
I guess i have a couple of questions here:
1.Does anyone know whats going on with the messed up rotation in first person mode with the AttachCameraToBone() function?
2.Does anyone know how to use the AttachCameraToBone() function in third person mode?
If anyone could help me with either of the questions it would be greatly appreciated!!
self.ideal_yaw=self.player_yaw;
ChangeYaw();
So when i go to see if my player can turn left to right, something very buggy happens. I move the mouse right, the player and camera start to turn right, then after about 70 degrees of turning, the camera starts turning left (while i keep trying to turn right), then after about 100 degrees of turning left the camera goes back to turning right (this is all happening when im trying to turn right with the mouse) . The camera seems to turn the other way only when im facing a certain direction.
After a while of testing, i think the problem lies in the fact that the camera was in first person mode (F1), but my scripted player was in "third person mode" (via the AttachCameraToBone() function). I think this is where the problem lies because i tried using the AttachCamera() function instead of AttachCameraToBone() and in first person mode the camera would rotate normally (which makes sense because the view was "first person", as in the eyes of the pawn). I know i should be in third person mode (F3) but the AttachCameraToBone() function doesn't seem to work in third person mode . Like when i use the AttachCameraToBone() function in third person mode (F3), the camera isnt attached to the the bone i specified, its just attached to the pawn like it would be if i used AttachCamera().
I guess i have a couple of questions here:
1.Does anyone know whats going on with the messed up rotation in first person mode with the AttachCameraToBone() function?
2.Does anyone know how to use the AttachCameraToBone() function in third person mode?
If anyone could help me with either of the questions it would be greatly appreciated!!