Hi ![]()
(see Picture)
I have an GameObject ‘PathA’, which has a Component ‘Script Instantiator’. This Scrit has Elements (Vehicles). Each Element has Component ‘Script AICar’. How can I get the name of the GameObject ‘PathA’ from the Element?
I am coding in the Script o
f the Element. I want to say somthething like: this.transform.gameobject → The parent Script → It’s parent GameObject, wich it is attached to.
Its actually the GetComponet Function the other way round, how can i code it?
,Hi ![]()
I have a GameObject ‘PathA’, which has a Component ‘Script’. The Script has a public List with Elements (Vehicles) in it. Each Element has the a Script ‘AICar’. I want to find the name of the GameObject ‘PathA’ through my Elements.
something like: this.transform.gameobject-> get it’s Script > gehts its GameObject which it is attached to.
