- Home /
The 'out' keyword (C#) Equivalent for Unity script.
Hi There.
I am following this tutorial series and they use this line of code:
function FindClosestHitObject(ray : Ray, hitInfo : RaycastHit, out hitPoint : Vector3) : Transform
My problem is that you can't use 'out' in unity script obviously, so what should I do to solve this problem without having to change my script to C#?
Cheers, Bradley.
Answer by HarshadK · Jul 08, 2014 at 07:21 AM
You don't need to specify out for hit variable in UnityScript.
You create a variable of type RaycastHit as:
var hit : RaycastHit;
Find detailed answer here: Raycast - convert from C# to UnityScript
Your answer
![](https://koobas.hobune.stream/wayback/20220613153513im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Possible to pass Unity classes to plugin directly? 0 Answers
Problem pc/android conversion 0 Answers
Android Game Conversion 1 Answer
Create PNG from dynamic mesh 1 Answer
How to covert unity scene file to flash/HTML5/WebGL/Unity3dFile 1 Answer