#now when i try to kill the other player
1 messages · Page 1 of 1 (latest)
you're doing it a little out of order
what Osmal just suggested is a good way to do it
the problem with the above is you're using a reference to photonView before getting it
it should look more like:
var photonView = hit.transform.GetComponent<PhotonView>();
if(photonView) photonView.RPC(...)
@waxen hazel I'd suggest moving into here 🙂
will help with the parallel conversations going on
with the TryGetComponent you still may need to do something like: hit.transform.TryGetComponent(out PhotonView pv) && pv
it doesn't look like TryGetComponent checks the state of pv
just that it is present on the game object you're getting it from
like this?
yeah
TryGet shouldnt return true if the component is destroyed
yeah that was my assumption as well
alr ill try rn
What line does this error point to
no line at all it just says this and when i click on it i get to the photon networking code
yeah, the error is being called 5000 times, seems like it may be pointing elsewhere?
click on the error, it should give a stack trace
somewhere there it should trace back to your source
it sends me to the photonnetworkpart script
And look at the stack trace in the bottom section of your console
See the top-most link in there? It points to PhotonNetworkPart line 1640
You can click that link and it should open that line
ah so it isn't the line you're working on
yeah
yeah
you should also update photonviewlist and remove dead views
okay
i have like 3 photonviews inside of my player
excluding the phtoonview on my player
dang this shi is too hard
should i just rewrite my weapon script?
so if the above script is on your player that is destroyed you likely need to look at how that script is built
if the parent game object is destroyed it shouldn't be executing code
this script is not on anything in the player its just on the pun2 package
cuz everything works until i try to kill a player
all the above checks treat the symptom, the root cause of the problem is really higher up somewhere in how you've built/destroyed your player
yeah cuz i just followed a tutorial on youtube