Passing method names, objects and script references between two objects

Hi there!
To be really honest with you I don’t know whether it’s possible to do this in a clever way.

Here’s the case: I have one object which when triggered should create an instance of an other object. To this instance the original object will need to send information about a method stored in this object. Because the created object should be able to call this method inside the original object. I don’t want to hard code the method references as I wish it to be able to work dynamically. Though I don’t really know how to realise this in code. I’m by the way using mainly C# when programming so I would appreciate if any code examples you give me is written in that language. Though I’m pretty confident with Javascript so I won’t get mad at you for Javascript examples.

To make it easier to understand what I want I’ve tried to put together an image which show the basics of what I want to do:

It’s not a complete answer, but this tutorial on delegates might give you a few ideas about how to go about passing function references around in Unity.

Thanks nomadking! I haven’t worked with delegates before so I’ll definitely take a look at the tutorial. And hopefully that will help me out :slight_smile: