Quantcast
Channel: Questions in topic: "declare"
Viewing all articles
Browse latest Browse all 78

declare script as variable, with variable in it type

$
0
0
hello there :) in this project players can generate script, and then save it with any name they want. in Dropdown players can choose they script's name and attach it to gameObject. all is fine except last step. i need to declare script as variable, with name of chosen name in Dropdown menu. but the name is in another variable, and Unity thinks, that another variable is scripts name. please, help) public var dropboxChoosedItemName : String; function LoadScript() { dropboxChoosedItemName = dropbox.GetComponent.().captionText.text; var newScript : dropboxChoosedItemName; } BCE0018: The name 'dropboxChoosedItemName' does not denote a valid type ('not found').

Viewing all articles
Browse latest Browse all 78

Trending Articles



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