I do not see a lot of Fire Stick, so I wanted to share a quick video and steps on how to support the Fire Stick:
Video:
Steps:
- Go to your Build Settings
- Visit Controller Input with Unity (Fire TV) | Amazon Fire TV
Input Settings:
-Go to Input in Unity
-Find Horizontal
-Make sure its named Horizontal
-Negative Button = left
-Positive Button = right
-Alt Negative Button = a
-Alt Positive Button = d
-Gravity = 3
-Dead = 0.001
-Sensitivity = 3
-Type = Joystick Axis (I this can be set to keyboard mouse but dont quote me on it)
-Axis = 5th Axis (Joystick)
-Joy Num = Get motion from all joysticks
Refer to the Amazon Document Link listed above if this setup dos not work - Code Setup
private void Update()
{
//direction = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")) * Time.deltaTime;
foreach (KeyCode kcode in Enum.GetValues(typeof(KeyCode)))
{
//Keypress Method
if (Input.GetKeyDown(kcode))
{
switch (kcode)
{
case KeyCode.Joystick1Button0:
Click_Bug();
break;
case KeyCode.LeftArrow:
Click_Random_Bug();
break;
case KeyCode.RightArrow:
Click_Random_Bug();
break;
case KeyCode.Escape:
Click_Home();
break;
case KeyCode.Menu:
Click_Home();
break;
}
}
}
}
My Code snippet is for a simple game I made. Use it as a reference but not a literal guide.
- In your Build Settings Select “Player”
-Other Settings
-Choose API level 22 as minim
-Check Android TV Comparability
-Works with D Pad - Other Documentation/References:
-Redirect | None
I hope this helps everyone who wants to build for Fire Stick. If I missed a step or something is wrong please post a reply.
