Hi guys,
I am new to the whole Unity game dev thing but come from an XNA background. Is it possible to get the players avatar in Unity?
–Dom
Hi guys,
I am new to the whole Unity game dev thing but come from an XNA background. Is it possible to get the players avatar in Unity?
–Dom
Yes.
There does exist an API that you can call from Unity (or anywhere really). It’s a public API that offers JSON or XML responses for some of the XBOX Live Gamer data. I understand that it’s not everything, however the avatar IS available!
The endpoint:
http://www.xboxleaders.com/api/games.json?gamertag=GAMER_TAG_HERE
Here’s is an example of a response:
{
"Data": {
"Tier": "gold",
"IsValid": 1,
"IsCheater": 0,
"IsOnline": 1,
"OnlineStatus": "Online playing COD: Black Ops II - Search & Destroy
on Overflow",
“XBLLaunchTeam”: 0,
“NXELaunchTeam”: 0,
“KinectLaunchTeam”: 0,
“AvatarTile”: “https://avatar-ssl.xboxlive.com/global/t.fffe07d1/tile/0/2000b”,
“AvatarSmall”: “404 - File or directory not found.”,
“AvatarLarge”: “404 - File or directory not found.”,
“AvatarBody”: “http://avatar.xboxlive.com/avatar/dwalsh83/avatar-body.png”,
“Gamertag”: “dwalsh83”,
“GamerScore”: 310,
“Reputation”: 20,
“Name”: “David Walsh”,
“Motto”: “Watch your head.”,
“Location”: “Madison, WI, US”,
“Bio”: “There is, and only can be, Call of Duty.”
},
“Stat”: “ok”,
“In”: 2.504,
“Authed”: “false”,
“AuthedAs”: null
}
You can check it out in full from the source.
From Unity, you can utilize this API using the WWWFormclass that is built in to Unity.
There is a avatar system for unity in the asset store that is VERY similar to xbox avatars, but that is the most I can help you with their.
– awesomeaustin316