Forum Discussion
naam00
12 years agoHonored Guest
Attach To Camera help
Hey Guys, Since the forum doesn't allow me to search for the string AttachGameObjectToCamera (I guess it's too long?), I suspect this may have been answered elsewhere, but other queries lead to not...
naam00
12 years agoHonored Guest
Does that work at your end? I tried that, but I get the mentioned error as soon as I do (though I do not use the return value).
ovrCam.AttachGameObjectToCamera( ref gameObject );
... leads to Unity complaining about ...
Assets/dialogSystem/DialogMessage.cs(62,54): error CS0206: A property or indexer `UnityEngine.Component.gameObject' may not be passed as `ref' or `out' parameter
Which would mean the OVR functions is wrongly constructed (needing a ref where a ref is illegal). Not a huge problem in the attach case (as all it does is some reparenting currently, and I can do that myself : ), but just wondered if it would be wiser to use the OVR functions.
Thanks,
Naam
ovrCam.AttachGameObjectToCamera( ref gameObject );
... leads to Unity complaining about ...
Assets/dialogSystem/DialogMessage.cs(62,54): error CS0206: A property or indexer `UnityEngine.Component.gameObject' may not be passed as `ref' or `out' parameter
Which would mean the OVR functions is wrongly constructed (needing a ref where a ref is illegal). Not a huge problem in the attach case (as all it does is some reparenting currently, and I can do that myself : ), but just wondered if it would be wiser to use the OVR functions.
Thanks,
Naam
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 7 months ago
- 3 years ago