- Home /
Question by
rainbow_design · Sep 05, 2015 at 07:31 AM ·
unity 5boo
How would look get component in Boo
Hello, i try to use
o.GetComponent<Image>().sprite = mysprite
to assign a sprite to my prefab gameobject. However i use Python. Since Boo is similar to python i would like to get the right syntax for that. Python does complain about the < > operator which means something completely different in python.
Comment
Thanks i found it: in Python it would look like this:
from UnityEngine.UI import *
o.GetComponent[Image]().sprite = mysprite
Best Answer
Answer by getyour411 · Sep 05, 2015 at 07:31 AM
For more info
https://unity3d.com/learn/tutorials/modules/beginner/scripting/getcomponent
(click the Boo button to see syntax)
Your answer
![](https://koobas.hobune.stream/wayback/20220612002628im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Visual Studio Code doesn't work for with unity 2 Answers
Macbook internal GPU crash 0 Answers
2D Camera Not Working? 2 Answers
Mutliplayer Player island 0 Answers
How to change properties of the standalone player form 1 Answer