I just want to know how can I rotate objects whenever my function outside fixedupdate and update is called. Call is coming from another function to this rotation. " transform.rotation = e_rotation;" works just fine inside Update function, but no outside
public class PlayerControlls : MonoBehaviour
{
private Rigidbody ThisBody = null;
private static Quaternion e_rotation = new Quaternion(0, 0, 0, 0);
public Transform ThisTransform = null;
public static float m_ZAxis;
public static float m_WAxis;
void Awake()
{
ThisBody = GetComponent<Rigidbody>();
ThisTransform = GetComponent<Transform>();
}
public static void Rotation(float m_ZAxis, float m_WAxis)
{
e_rotation.z = m_ZAxis;
e_rotation.w = m_WAxis;
transform.rotation = e_rotation;
}
error CS0120: An object reference is required for the non-static field, method, or property 'Component.transform'