Script not working But in the tutorial it did work just like this
hey guys im running the latest version of unity 5.3
i followed a tutorial on rpc to see what im doing wrong with my own rpc`s but this one does not work !!!!
using UnityEngine;
using System.Collections;
public class Jumpright : MonoBehaviour {
// Use this for initialization
void Start () {
GetComponent<NetworkView>();
}
// Update is called once per frame
private void Update () {
if (Input.GetKeyDown(KeyCode.Space))
NetworkView.RPC("JupmRight", RPCMode.All,null);
}
[RPC]
public void JumpRight()
{
transform.position += Vector3.right * 2;
}
}
Couple questions, is there a reason your using RPC ins$$anonymous$$d of ClientRPC? It looks like you are following a Legacy tutorial. Which tutorial did you follow? and was it for Unity 5.x+? Little details can be a big help diagnosing the problem.
Answer by tanoshimi · Jan 19, 2016 at 01:50 PM
Several problems with this code, but the most glaring one is:
JupmRight
there are formatting inconsistencies, but what other 'problems' do you see?
Your answer
Follow this Question
Related Questions
Which music goes? 0 Answers
Rigidbody changes reference in play time to the game object that the script is attached to 1 Answer
Help with web request. 0 Answers
Bullet doesn`t die when enemy destory 1 Answer
Create UI Text from script 1 Answer