Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

OnMouseDown() with Network Instantiated objects

$
0
0
I added a basic monobehaviour with an OnMouseDown() function to a network spawnable object . This is so the player can select the object at runtime by clicking on it.

The OnMouseDown() works when the object is in the scene at startup, but not if it's instantiated at runtime using PhotonNetwork.Instantiate()

Assistance is appreciated.

Snippit:

using UnityEngine;
using System.Collections;

public class Commandable : MonoBehaviour
{
public void OnMouseDown()
{
Debug.Log("OnMouseDown");
}
}

Viewing all articles
Browse latest Browse all 8947

Trending Articles