There is a way to instantiate a prefab and acess a component from it ?
I want to instantiate a bullet, and then i say to the bullet for e.g: “Hey, your power is this and your range is this”.
Hope you understand my question
There is a way to instantiate a prefab and acess a component from it ?
I want to instantiate a bullet, and then i say to the bullet for e.g: “Hey, your power is this and your range is this”.
Hope you understand my question
Sure, do this:
var obj = (GameObject)Instantiate(...);
obj.GetComponent<WhatComponent>().DoSomething();
Replace DoSomething with whatever you want to do, or store the result of GetComponent in a variable if you need to do more than one thing.