You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a weapon prefab and an ability object that needs to reference the weapon's model. This reference is setup when the player is started but fails to use said reference when an RPC is called. This is called for every instance on every client, and using [Property] I can see that the components are properly set up.
Code:
privateSkinnedModelRenderermodel;// Called for each player instance on every client. Owner or not.publicoverridevoidSetup(){base.Setup();model=Player.Combat.Weapon.Model;}// This function warns that model is unknown despite model is NOT null.[Rpc.Broadcast]privatevoidDoAnim(){if(!model.IsValid())return;model.Set("Parry",true);}
Log:
OnObjectMessage: Unknown Component [76de8246-5cf7-4ee6-b39b-92587a09bb5a](arg:0) on examplesword for RPC DoAnim
To Reproduce
Have a networked prefab reference a child prefab component on every client.
Try to access it via RPC.
Expected behavior
I should be able to reference the component that I set a reference to earlier.
Media/Files
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
dotryen
changed the title
Networked Prefab has trouble referencing child prefab objects through RPCs
Networked Prefab has trouble referencing child prefab components through RPCs
Jan 16, 2025
This would indicate to me that the object the component is on is not actually a networked object. This looks like the kind of RPC error you get when an object isn't networked - are you sure the game object is set to Networked Object in the inspector?
Describe the bug
I have a weapon prefab and an ability object that needs to reference the weapon's model. This reference is setup when the player is started but fails to use said reference when an RPC is called. This is called for every instance on every client, and using
[Property]
I can see that the components are properly set up.Code:
Log:
To Reproduce
Expected behavior
I should be able to reference the component that I set a reference to earlier.
Media/Files
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: