Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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:
    39,029