I'm trying to use Unity's raycasting methods.
For example the following function:
(defn raycast [^Ray ray] (let [hit (RaycastHit.)] (when (. Physics (Raycast ray (by-ref hit))) hit)))
The problem is that this will fail as the first parameter of Raycast is expected to be a Vector3 and not a Ray.
Raycast is overloaded, some of the calls gets two Vector3s as the first two parameters and some other gets a Ray as first parameter.
I've tried with everything I could find, from casting to type hint string but I don't seem to be able to make it choose the correct overload.
Is there a way to force the overload that should be chosen?
:importit in your clojure code, and call the static function :)
Edit -> Project Settings -> Input Manageryou can do something like:
(import '[UnityEngine Input]) (defn do-something [game-obj key] (when (Input/GetButtonDown "Fire1") ; do something ) (hook+ game-obj :update :click #'do-something)
:starthook entry point as per https://github.com/arcadia-unity/Arcadia/wiki/Using-Arcadia#entry-point
(object-named ...)to attach things using code instead