Quantcast
Channel: Latest Questions by Santa
Viewing all articles
Browse latest Browse all 88

Pointers in function parameters

$
0
0

How to pass a pointer to structure to a function? For example in this function I need to change Vector3 value:

function ChangeVector( vec : Vector3 ) { vec.x = 0; }

function Main( ) { var vec = Vector3( 1, 1, 1 ); ChangeVector( vec );

... vec.x should be 0.

As far as I look at Collider.Raycast which is:

function Raycast (ray : Ray, out hitInfo : RaycastHit, distance : float) : bool;

and where RaycastHit is structure it is possible to do it.

PS: Is it possible to do this for simple variables like "int"?


Viewing all articles
Browse latest Browse all 88

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>