trouble setting camera position

im trying to set camera position with setPos and setHpr so that when the camera reaches a certain position in the environment, it’s reset to a starting origin. but no matter what i try, i always end up with some random starting point…
i’ve disabled mouse from conflicting with camera as well, so it seems to me that the movetask is being executed before the first render.

in addition to this, when the position input is of larger values, sometimes when the camera reaches the position indicating that it should teleport back to the origin, the camera will jump out of the environment…

any help is appreciated!

Well, we’ll need a bit more information to help you with that. Could you perhaps show some code, show us how you’re updating the camera?

Also, make sure that you have called base.disableMouse() to make sure that ShowBase does not have any more control over the camera.

yes, the issues have more or less been solved… half of it was that the walls of my environment were too thin, so that the collision detection failed when movement was too fast. the other half was that somehow, camera position was being updated quite a lot before the initial frame was rendered, so that the starting position was offset by this unrendered update in position.

That’s why I always create a “Mother Task” which keeps all movement updates (including camera) and collision detection in sync.

Works like a charm. :smiley: