What is best practice for dealing with Prefab(with attached script) and passing arguments in constructor?

Hello,

I am using Creator 3.4.1
I am creating many different Prefabs, all having different scripts attached.
Now my question is how can i pass some arguments in prefabs’s script constructor when i instantiate(prefab)?

Regards,
Smit

When instantiate prefab, you can not pass some arguments in prefab’s script constructor, because the script attached in prefab is Component’s subclasses, and Component is created by engine.

The instantiate process doesn’t accept any parameter, but you can do any customization after prefab instance created, just modify component properties in prefab instance.

yeah, now i am creating prefab and calling my own method onInit for initialise Node.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.