0

I have a multiplayer 2D game made in Unity and I wanted to put some onscreen buttons to be able to control it on the telephone. The problem is that when I put the Event Trigger on the button it uses the function from the script that has to use, but it can't open other functions called in the first one. For example, when I press the FireBullet Buton it should use a function CmdFireBullet() that has in it the function RpcFireBullet(). The function CmdFireBullet() works perfectly, but it does not open the function RpcFirebullet() at all. Any ideeas?

5
  • 1
    What do you mean does not open? Do you call the RpcFireBullet method in CmdFireBullet? Also it would be helpful for us to understand if you can share your methods. Commented Feb 15, 2019 at 8:54
  • 1
    CmdFireBulletand RpcFireBulletsounds like you are using UNet or something simmilar. Is that the case? Please post some code so we can see what you are trying to do. Commented Feb 15, 2019 at 8:58
  • Yes @Ali Kanat I am calling RpcFireBullet method in CmdFireBullet and Yes TehMightyPotato I am using UNet. I will paste here the code (you can find there the CmdFireBullet and RpcFireBullet) pastebin.com/ACgnggtL Commented Feb 15, 2019 at 10:19
  • You commented out that method which calls RpcFireBullet. You have two CmdFirebullet methods your button only calls the one starting in line 171 because the other one is commented out. Commented Feb 15, 2019 at 10:32
  • I know that, the other CmdFireBullet and everything that is commented are previous versions of the functions and those don't have to work. Commented Feb 15, 2019 at 10:37

1 Answer 1

1

There is no RpcFireBullet inside CmdFireBullet Just don't forget to type RpcFireBullet(); inside your CmdFireBullet

Sign up to request clarification or add additional context in comments.

1 Comment

Sry, I wanted to say that it does not get inside RpdAdaugaViteza()* I forgot that I made a new function to add speed to the bullet and I deleted RpcFireBullet().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.