Orientation matrix to vector?

Hey all, i am in a real rush, because some of my code isn’t working for the BWGMC.
Basically i am doing some server side stuff which prevents me from using gameObjects, and so i am sending positions direct
Essentially, i want to take a standard rotation matrix


and rotate that to face an enemy.
This code works, but only when it is in front of the enemy, suggesting there is some issue with negative/positive.
Can anyone help me rotate a blank matrix to face a gameobject when given a path (vector) to the game object?

path = enemy_position-own.worldPosition
rot = Vector([-1,0,0])
ang = path.angle(rot)
orientation = Matrix.Rotation(ang, 3, 'Z')
own.worldOrientation =orientation

Use alignAxisToVect()


Thanks, but if you read the first post, i had to avoid that, because im not using GameObjects. Thanks though!

Your second code snipped uses a gameObject (see line 1)

Beside that, why should your server perform geometric transformations?
That is a task for the clients, before sending data or after receiving data. Otherwise you need to manually implement geometric operations.

Ah, i showed you my test snippet. To be honest it was merely for some experimentation. I could (and have done) just send the vector to the client.
Thanks Monster for your time.