Quote:
One more Question Julz, sorry that i am asking that much.
No worries laugh I'm not normally very helpful around here but these kind of problems really interest me (hence my original quaternion and alignToVec contributions). If I didn't want to help out I'd leave it for someone else to answer.

It's hard to define an absolute pan orientation when an object's local z axis is changing. I think the best approach is to find a vector that represents the direction you want the object to face, and then rotate around one axis to face that vector.

Here's a slightly changed action le():
Code:
action le()
{
	var relTilt = 0;
	player=me;
	VECTOR temp;
	while(1)
	{		
		gravitz();
		if(key_space&&!oben)
		walk_speed.z=5;
		my.skill9=100*(key_k-key_l);  //Target angle/ 100 or -100
		alignToVec(my.pan, normal, vector(0, 0, 1), time_step);

		vec_for_angle(temp, vector(my.skill9, 0, 0)); // get a vector pointing where we want to point
		vec_rotateback(temp, my.pan); // find that vector relative to the entity's current orientation
		vec_to_angle(temp, temp); // convert to a rotation
		c_rotate(my, vector(ang(temp.x*0.9*time_step),0,0),GLIDE|USE_AXISR);
		
		c_move(my,vector((key_w-key_s)*20*time_step,(key_a-key_d)*20*time_step,walk_speed.z),nullvector,GLIDE | IGNORE_PASSABLE|IGNORE_FLAG2);

		wait(1);
	}
	
}


I don't think it's a good idea that you use c_rotate and change the entity's orientation directly (passing my.pan to alignToVec). The latter doesn't perform any collision detection, and the former is unnecessarily slow if your objects have complete spherical symmetry (max_x = max_y = max_z = -min_x = -min_y = -min_z). I did it your way anyway because I wanted to change your code as little as necessary.

I hope that makes sense.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!