I am trying to rotate a child object by its transform, but instead if the child rotating the parent does.
GameObject lObject;
Transform lTransform;
void Start ()
{
lObject = new GameObject("lObject");;
lObject.transform.SetParent(transform);
lTransform = gameObject.GetComponentInChildren<Transform>();
}
void Update ()
{
lTransform.Rotate(Input.GetAxisRaw("Mouse Y"),0,0);
}