Strange Camera Pitch Problem

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Strange Camera Pitch Problem

Post by metal_head » Thu Dec 17, 2009 11:10 pm

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?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Strange Camera Pitch Problem

Post by Juutis » Thu Dec 17, 2009 11:36 pm

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)
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Strange Camera Pitch Problem

Post by metal_head » Fri Dec 18, 2009 5:05 pm

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)

Post Reply