Forum Discussion

flarb's avatar
flarb
Partner
7 months ago

All of a sudden...no components found on entity

So just randomly tonight---my projectile is hitting the correct entity. I print out the name and it is the right one. But when I call getcomponents on it, there are no components on it. But that's clearly impossible. Also I didn't change any of this code or the asset for the entity that is being hit. It's just like all of a sudden it stopped being able to get component references from the entity reference passed in from the projectile entity hit event.

Usually at times like these, it means that I should go to bed and miraculously some server issue is cleared up in the morning that makes my world work...but I dunno. This one is super weird.

I've verified the entity is correct--but the array that comes back from getcomponents is empty. Not to mention when I try to get the specific component I want (there's only one on this thing!) it can't find it either.

Anyone ever come across this?

2 Replies

  • Ok, so the issue is--you can't all getcomponent on a server object from a local object. So I made a network event and now it works! But the strange thing is....until recently these calls worked.

    Well now I have an entirely different issue--in these network events on my server objects, I cant set player vars on the player I pass in as a parameter.  It keeps complaining that I can't set vars on a server player. But I should start a separate thread for that.