Search Unity

Question Help with buttons

Discussion in 'Scripting' started by S4MA3L, Jul 8, 2020.

  1. S4MA3L

    S4MA3L

    Joined:
    Apr 17, 2020
    Posts:
    38
    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.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742