Hi guys, I came up with this problem. I am using TairaGames’ point to click tutorial.
using UnityEngine;
using System.Collections;
public class SendInfo : MonoBehaviour
{
void Start()
{
}
void Update()
{
bool RMB = Input.GetMouseButtonDown(0);
if (RMB)
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit) && hit.transform.tag == "Ground")
{
this.GetComponent<PhotonView>().RPC("RecievedMove", PhotonTargets.All, hit.point);
}
}
}
}
There error is:
NullReferenceException: Object reference not set to an instance of an object SendInfo.Update () (At Assets/Scripts/SendInfo.cs:23)
I looked at like 23, and couldn’t find anything wrong with it;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
I don’t want to discourage you, but you are still new, I really don’t recommend to trying a muktiplayer game. Just try simple games and add more and more to them. I remember when I started, networking just went over my head lol. Just trying to help
I’m not necessarily ‘new’ to coding it’s just I am new to unity. I use Photon for networking which finishes most of the network off, well to my knowledge. This is more of a test project to see what unity can do.