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?
1 Answer
There is no RpcFireBullet inside CmdFireBullet Just don't forget to type RpcFireBullet(); inside your CmdFireBullet
1 Comment
Vlad6001
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().
RpcFireBulletmethod inCmdFireBullet? Also it would be helpful for us to understand if you can share your methods.CmdFireBulletandRpcFireBulletsounds 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.RpcFireBullet. You have twoCmdFirebulletmethods your button only calls the one starting in line 171 because the other one is commented out.