- Home /
Grenade skill with UNet multiplayer (using scriptable objects)
I'm trying to make a grenade skill in my game using ScriptableObjects. Each SO has a few functions which are called by the PlayerStats script. The GrenadeSkill script instantiates a grenade, applies the force, etc, and then spawns it on the clients. When I do this on the server, there is no issue. However, I can't do it on the client without using a command. But I can't use a command on the SO because it's not a NetworkBehaviour.
So, I tried adding some command functions on the PlayerStats script to instantiate it, spawn it on the server, add the forces, etc. But when I try to do it on the client, it throws "ArgumentException: The thing that you want to instantiate is null." I'm really confused as to what's causing this, as the grenade prefab is assigned in the editor. I've also included the GrenadeSkill and PlayerStats scripts in case anybody needs them to identify the issue.
Thanks!
Your answer
Follow this Question
Related Questions
Sync reference to ScriptableObject over UNET? 0 Answers
Prefab not spawning on client correctly 1 Answer
Unity networking tutorial? 6 Answers
Add a GameObject as a sub-asset of a ScriptableObject 1 Answer
unity game 1 Answer