Game Development Community

Problem with setCurrentCameraArea

by Manuel F. Lara · in Torque Game Builder · 06/20/2006 (9:20 am) · 1 replies

For some weird reason, setCurrentCameraArea doesn't work when I use a minY value of less than -35. I mean, I have a function called each frame with syncs the camera position (using setCurrentCameraArea) with the position of a given invisible camera pivot. I don't use mount() because I also zoom in/out the camera and both things can be done simultaneously (why, oh why?!).

So, in that function I just do something like setCurrentCameraArea(%pivotPosX - 50, %pivotPosY - 35, ...); to set use the pivot as the camera center. The thing is, when the pivot's Y-pos is less than -35, the camera area is not updated, the pivot keeps moving around while the camera keeps being at the old position (the one before the pivot entered the y < -35 area).

Some facts:
- The pivot *is* moving. I enable debug info and I set its bounding box moving around OK.
- The function which calls setCurrentCameraArea *is* being called each frame, and it doesn't returns before calling setCurrentCameraArea or anything, there isn't any 'return' statement in the whole function, actually.
- I've tried with setViewLimitOff() but even calling it right before any setCurrentCameraArea call has no effect.
- The camera seems to work well with whatever value except when minY is less than -35 (so X doesn't affect at all, and Y's can be any value higher than -35).


Any ideas?

Thanks in advance.

#1
06/22/2006 (10:36 am)
Feel free to zip up and send me your working directory to:

mattl AT garagegames DOT com

and I'll try and fit some time in to check it out :)