Page 1 of 1

Strange Camera Pitch Problem

Posted: Thu Dec 17, 2009 11:10 pm
by metal_head
OK...not sure where to post this, cuz it totally seems like a bug. In my sidescroller project, I'm using a scripted player with another pawn, attatched to it to hold the camera. The problem is that when I tigger a level change and get spawned on the new level, the camera gets randomly pitched either upwards or downwards. I put a

Code: Select all

debug(self.current_pitch);
in the script, but it showed 0.00000 and that's the value it should be showing, so than I wrote this:

Code: Select all

self.pitch_speed = 1000000;
self.ideal_pitch = 0;
ChangePitch();
Still nothing changed so I'm sure it's not the pawn. Ok so than I put a debug(self.camera_pitch) and wow, strange, but it showed different than 0 value after the next level loaded.... pretty strange. Can you help me fix this thing?

Re: Strange Camera Pitch Problem

Posted: Thu Dec 17, 2009 11:36 pm
by Juutis
The camera pitch has nothing to do with the pitch of the pawn it is attached to. What I believe is happening is that you can move the mouse freely when the new level is loading and then in the start of the level RF detects that the mouse has moved and tilts the camera. A simple TiltCamera() should fix it:

Code: Select all

TiltCamera(camera_pitch);
(I'm not sure if it should be 'camera_pitch' or '-camera_pitch', see for yourself which one works)

Re: Strange Camera Pitch Problem

Posted: Fri Dec 18, 2009 5:05 pm
by metal_head
Yeah, that's what I also think it is. I just firstly checked if the pawn get's rotated so I can know where to look for the problem. Thanks, I'll try, I tough of using the TiltCamera, but didn't think of a way to use it, your seems fine, I'll check if the current camera pitch is smaller or larger than zero so I can know which one to use (camera_pitch or -camera_pitch)