-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touch controls on Android not functioning when built properly #248
Comments
Not sure if this is an android specific issue. It might be related to #323 which we have confirmed is happening. Its likely that hooks are being dropped before export as well, resulting in scenes with no clojure code in the exported game. I tested first on the desktop with (ns issue-248
(:import [UnityEngine Input Vector3 Camera])
(:use arcadia.core))
(defn box-hook-mouse [this k]
(set!
(.position (.transform this))
(.ScreenToWorldPoint Camera/main
(let [pos Input/mousePosition]
(Vector3. (.x pos) (.y pos) 10))))) with (hook+ (object-named "Cube") :update :issue-248 #'box-hook-mouse) It replicates the posted code above but uses a mouse as input. The game builds, launches and runs without error, and the hooks disappear in the inspector. On Android I tested with (ns issue-248
(:import [UnityEngine Input Vector3 Camera])
(:use arcadia.core))
(defn box-hook [this k]
(when (> (count Input/touches) 0)
(set!
(.position (.transform this))
(.ScreenToWorldPoint Camera/main
(let [pos (.position (first Input/touches))]
(Vector3. (.x pos) (.y pos) 10)))))) with a similar setup as on desktop. Again, everything built and ran without errors, and |
This is actually looking like a compiler bug. With #323 fixed, running the above code on Android throws the following in
The full thing is here |
As of 0689ff6 the android code I posted above exports and functions as expected |
Android touch controls don't function seemingly at all when used in a finished apk.
To reproduce:
Single scene in the build settings, containing a camera with an ortho view and a near clipping plane of 0, and a single sprite with the following hook on update:
Building is done while connected to the device in developer mode after ensuring the android build post-process does not occur in arcadia, and the following code is run in the repl:
The resulting .apk should be send to the android device just fine, and run as well, but any touch controls will not function.
NOTE: The above setup works perfectly when using unity remote, touch controls are received properly and can be manipulated any way desired.
The text was updated successfully, but these errors were encountered: