Post

Code Monkey
Code Monkey@UnityCodeMonkey·
Does this code compile? private void SetTarget(Transform target) { GameObject targetGameObject = target; } A) No B) Yes C) Yes if target is not null (answer in reply below)
English
5
0
16
7.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
#### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### (A) You cannot implicitly convert a transform into a gameobject. However every gameObject has a transform and every transform has a gameObject so this would work: GameObject targetGameObject = target.gameObject; What is the DIFFERENCE between Transform and GameObject? youtube.com/watch?v=B-dVf9…
YouTube video
YouTube
English
1
0
8
2.1K
Paylaş