x


Unity 3.5 Beta input doesn't work in Flash builds

I've been trying to fix this for about 2 days or so, and i've searched all over the ask and forums for an answer.

Here's my question: I have been trying to just do a very simple test deployment for Flash but it seems that no matter if I use Input.GetAxis or Input.GetKey it will work in unity's editor, but it will not work in the Flash.swf file that I build it to.

Here's my build: I've just made a cube that has a script attached to let the user move it left or right based on the arrow keys or 'A' or the 'D' keys.

The script is: #pragma strict function Update () { var horizontal:float = Input.GetAxis("Horizontal"); transform.Translate(horizontal, 0, 0); }

and the script is attached to the cube. Again it works perfectly fine in editor but doesn't work at all when it's deployed to Flash. also when I use Input.GetKey it doesn't work.

more ▼

asked Dec 29, 2011 at 09:29 AM

hathzynx gravatar image

hathzynx
1 3 2 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Hi,

It's not your code... It's some bug I was fighting with too. Try clicking on the Flash movie and then press the direction keys, it will work.

For some reason the Flash object loses its focus in the html page! So I was thinking about starting with some button saying "Click to Start" or something in order to get the focus.

Hope this solves your problem.

more ▼

answered Dec 29, 2011 at 06:43 PM

Chakasama gravatar image

Chakasama
1

I try clicking in the flash window to focus it, but it still hasn't worked all day.

Dec 29, 2011 at 10:39 PM hathzynx
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x7197
x1647
x342

asked: Dec 29, 2011 at 09:29 AM

Seen: 1212 times

Last Updated: Dec 29, 2011 at 10:39 PM