Hey,
I have problems calculating how my player needs to rotate in order to face a mob.
What I do now is this:
This basically gives me the angle between two vectors. The two vectors are the player and the mob. But the value temp is not 0, nor 2Pi, when I face a mob.Code:facing = (Pos.x * Object.x + Pos.y * Object.y + Pos.z * Object.z ) / ( sqrt( pow(Pos.x, 2) + pow(Pos.y, 2) + pow(Pos.z, 2) ) * sqrt( pow(Object.x, 2) + pow(Object.y, 2) + pow(Object.z, 2) ) ); temp = acos(facing);