I created a c# movement script for my player. It is a multiplayer game using photon. The movement script is working but I want to make ot work with some UI buttons. I want to reference specific input buttons from my player prefab which contains my movement script. I can't add my methods to onclick() function on the button from inspector as my prefabs are only instantiated when connected to a room. Please help . There might be some easy way around this but I can't find any.
You can add things dynamically to the button's onClick listener, kinda like-a dis: https://answers.unity.com/questions/1288510/buttononclickaddlistener-how-to-pass-parameter-or.html Usually you do it in Start(), but you could do it later once the thing you need has been instantiated.