#now when i try to kill the other player

1 messages · Page 1 of 1 (latest)

keen forge
#

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

upper obsidian
#

hmm still doesnt work

keen forge
#

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

upper obsidian
#

like this?

keen forge
#

yeah

waxen hazel
#

TryGet shouldnt return true if the component is destroyed

keen forge
#

yeah that was my assumption as well

upper obsidian
#

alr ill try rn

waxen hazel
upper obsidian
#

no line at all it just says this and when i click on it i get to the photon networking code

keen forge
#

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

upper obsidian
#

it sends me to the photonnetworkpart script

waxen hazel
#

Click it once

#

Not twice

upper obsidian
waxen hazel
#

And look at the stack trace in the bottom section of your console

waxen hazel
# upper obsidian

See the top-most link in there? It points to PhotonNetworkPart line 1640

#

You can click that link and it should open that line

upper obsidian
#

yeah im in it rn

keen forge
#

ah so it isn't the line you're working on

upper obsidian
#

yeah

keen forge
#

same thing, in that if you need to check view

#

if(!view) continue;

upper obsidian
#

yeah

keen forge
#

you should also update photonviewlist and remove dead views

upper obsidian
#

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?

keen forge
#

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

upper obsidian
#

cuz everything works until i try to kill a player

keen forge
#

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

upper obsidian