Access to collider photonView
Options
marf
✭
Hi, i'm using this script to send the damage to a player:
void OnCollisionEnter(Collision other){
// ....
}
Now what I need to do to access to other.gameObject.photonView for example?
Thanks a lot,
Marco
void OnCollisionEnter(Collision other){
// ....
}
Now what I need to do to access to other.gameObject.photonView for example?
Thanks a lot,
Marco
0
Comments
-
there is no photonView as this is not a unity class (these .xxxx are all only properties in the end)
you have to use GetComponent<PhotonView>() instead (which is what networkView internally does for NetworkView for example)0 -
Ok, thanks a lot, now I start a new project, but when I import the Photon Unity Networking it says:
Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs(35,93): error CS0117: `Path' does not contain a definition for `GetFileNameWithoutExtension'
I don't edit it, this is the code:// -------------------------------------------------------------------------------------------------------------------- // <copyright file="PhotonNetwork.cs" company="Exit Games GmbH"> // Part of: Photon Unity Networking // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System.Collections; using System.Collections.Generic; using System.IO; using ExitGames.Client.Photon; using UnityEngine; /// <summary> /// The main class to use the PhotonNetwork plugin. /// This class is static. /// </summary> public static class PhotonNetwork { /// <summary> /// This Monobehaviour allows Photon to run an Update loop. /// </summary> public static readonly PhotonHandler photonMono; /// <summary> /// Our photon class /// </summary> public static readonly NetworkingPeer networkingPeer; /// <summary> /// The maximum amount of assigned networkviews PER player (or scene). See the documentation on how to raise this limitation /// </summary> public static readonly int MAX_VIEW_IDS = 1000; // VIEW & PLAYER LIMIT CAN BE EASILY CHANGED, SEE DOCS public static ServerSettings PhotonServerSettings = (ServerSettings)Resources.Load(Path.GetFileNameWithoutExtension(NetworkingPeer.serverSettingsAssetPath), typeof(ServerSettings));
I don't know where is the error, it's very strange!0 -
you are on the wrong platform.
Ensure its a windows, osx, iOS or Android project0 -
Thank you.0
-
i have the same problem when i changed files but with the same projects0