How can Achieve this without gameobject?

[serializefield]

GameObject gunspawn;

Vector3 thedirection = Some Value;

gunspawn.transform.forword = thedirection.normalized;

Quaternion therotation = gunspawn.transform.rotation;

I need this value(therotation) without using a gameobject ?

how can I get the rotation of gunspawn?

I think that this might work:

Quaternion therotation = Quaternion.LookRotation(thedirection, Vector3.up);

More on that:

3 Likes

Thanks a lot very helpful