Strange Behavior: alignAxisToVect

Hey there… I have discovered a very strange behavior! It is about my Particle System!

My Particles are getting aligned manually to my view. I am not using the halo option. And I don’t want it to use because I loose some options for my system with it!

I get my view with scene.active_camera

I am aligning them with alignAxisToVect. Everything works perfect in perspective mode, but in Orthographic mode I get randomly one Error:
alignAxisToVect() Error: Null vector!
And my particles to not get align to my view.
When I switch the View to my Camera and set the Camera to Ortographic the Error dissapears. But when using a free view from my viewport I get this Error.

Has someone noticed something similar or know how I can avoid this error?

Thanks in advance!
Andreas

I guess “Null Vector” is a vector with a zero length = (0,0,0). It has no direction and can therefore not be used to align anything to it.

Please verify that the input is correct.

ok… I think I have found the problem.
When my view is set to ortographic my active_camera has a position of (0,0,0). And when changing the pivot of my view the position of the active_camera changes to the exact pivot position!
In perspective it has the real 3D coordinates.

Does anyone know how to reset the view position of the ortographic camera to its actual perspective camera?

Edit
This won’t be really a problem when I use an ortographic view later in the game. Because I have a camera! But it is a problem for quick tests when my view is not set to the camera!

I hope you get what I am saying here! Could be confusing from just reading my problem ^^

You could add Python code that looks for the temporary camera: “default__cam”. Then move it away.

Or you automatically switch to the camera you have with the camera actuator (make sure to run your code after this switch)