Search Unity

Adding Force on player on networked multiplayer

Discussion in 'Multiplayer' started by hypnoticgoat, Nov 21, 2014.

  1. hypnoticgoat

    hypnoticgoat

    Joined:
    Nov 21, 2014
    Posts:
    2
    Hey All,

    We have a game currently setup using photon unity network. We are trying to add forces to objects over the network, however the force being sent over the network(RPC) is not being applied to the player. Could someone please help us identify the problem?

    We are synchronizing the player rotation and position using photon view.

    Code (CSharp):
    1.     [RPC]
    2.     void ApplyGrappleForce(Vector3 force)
    3.     {
    4.         if(photonView.isMine)
    5.         {
    6.             Debug.Log("SelfCall Grapple force" + force);
    7.             armCollision.rigidbody.AddForce(force, ForceMode.Acceleration);
    8.             PhotonView pv = armCollision.GetComponent<PhotonView>();
    9.  
    10.             photonView.RPC("ApplyGrappleForce", PhotonPlayer.Find(pv.owner.ID), force);
    11.         }
    12.         else
    13.         {
    14.             Debug.Log("NetworkCall Grapple force" + force);
    15.  
    16.             photonView.rigidbody.AddForce(-force, ForceMode.Acceleration);
    17.           // rigidbody.AddForce(force, ForceMode.Acceleration);
    18.            
    19.  
    20.         }
    21.     }
     
  2. hypnoticgoat

    hypnoticgoat

    Joined:
    Nov 21, 2014
    Posts:
    2
    Nevermind, we figured it out.
     
  3. maglat

    maglat

    Joined:
    Jul 9, 2010
    Posts:
    111
    Feel free to share your knowledge with us :)
     
  4. Muber Gaming

    Muber Gaming

    Joined:
    Jan 24, 2014
    Posts:
    48
    people join here to humbly seek answers and share knowledge basically a two way ticket trip
    to keep the community alive.
    but as you can see,some people just seem to do a one way ticket and do not give a damn. selfish anyone? lol

    sad thing, where i come from there is an specific word for this kind of leeches, which i wont state due of its rating
    but you might probably already guessing.



    anyways looking at his posts "2" seems that will be the last you see of him.

    in most cases they are existing users who are too ashamed of being judged as noobs or leechers so they create new account just for noob or leeching requests like this one.

    that is until next time he gets stucked , but he'll be smart enough to create a brand new forum user.


    like maglat said:
    "Feel free to share your knowledge with us"