I’m confused. I always though India was part of the common wealth, but I’ve been playing hearts of iron four, and it’s pretty much it’s own country, was it part of the uk or was it something else? Sorry if my question isn’t clear enough.
First things first, though games that are set in a historical setting can be extremely useful in learning and understanding the past, they aren't a historical source in their own right. There are a multitude of factors that go into why a game like Hearts of Iron IV might portray the world of the late 30s and early - mid 1940s differently than it was; in regards to its depiction of the British Raj, its depiction simply comes as a result of the mechanics of the games engine.
With that in mind, to answer your question, the British Raj's position is somewhat confusing to those who aren't intimate with British Imperial administration and politics. But, I'll endeavour to give you an accurate and understandable answer:
So, essentially, the British Raj was, officially, a separate and independent nation that shared a head of state with Britain - during the Second World War this head of state was George VI, who ruled as both King of the United Kingdom and as Emperor of India (collectively referred to as the King-Emperor).
Though the Raj was, in name, an independent state... it was in reality an imperial possession of the British Empire that was governed through a colonial government headed by a colonial governor - this governor being the Viceroy of India, an official appointed by the elected government of Britain on behalf of the King-Emperor (or in Victoria's case the Queen-Empress).
Alongside the Imperial Legislative Council and the wider colonial governmental apparatus, the Viceroy of India governed the British Raj largely in accordance to the wishes of the imperial government in London. At times the Viceroy and his administration had to contend with the Indian Princes, who governed roughly 40% of India as client states to the colonial government in a region collectively known as the Princely States. But, in general, the Princes towed the line of the Viceroy's colonial government.
Though the Balfour Declaration in 1926, the foundational document of the Commonwealth of Nations, established that the various dominions and colonies that constituted the British Empire were "equal in status" and "in no way subordinate one to another in any aspect" - this was not the case with British India, as the British government still had immense sway and influence over the government of the Raj (as it did with the vast majority of the other governments of the Commonwealth).
To tie it all together, the British Raj was, officially, its own nation that was a part of the Commonwealth, however due to the nature of British imperial politics it was in reality a colonial dominion governed on behalf of the British government in London.
Hopefully this answers your question. Feel free to ask any further questions if you feel so doing.
Interesting Sources on the Raj:
Bandyopadhyay, Sekhar. From Plassey to Partition: A History of Modern India. Hyderabad: Orient Longman, 2004.
Bayly, C. A. Indian Society and the Making of the British Empire. Cambridge: Cambridge University Press, 1990.
Copland, Ian. Princes of India in the Endgame of Empire, 1917 - 1947. Cambridge: Cambridge University Press, 2002.
Chandra, Bipan, Mridula Mukherjee, et al. India's Struggle for Independence, 1857 - 1847. Delhi: Penguin Books, 2016.
Dodwell, H. H. The Cambridge History of India - Volume 6: The Indian Empire 1858 - 1918: With Chapters on the Development of Administration 1818 - 1858. Cambridge: Cambridge University Press, 1932.
Gilmour, David. The British in India: A Social History of the Raj. New York: Farrar, Straus, and Giroux, 2018.
Low, D. A. Eclipse of Empire. Cambridge: Cambridge University Press, 1993.
Majumdar, Ramesh Chandra. British Paramountcy and Indian Renaissance in the History and Culture of the Indian People. Bombay: Bharatiya Vidya Bhavan, 1970.
James, Lawrence. The Rise and Fall of the British Empire - Part Four, Chapter Five: A New Force. New York: St. Martin's Griffin Publishing, 1997.