spatialos/gdk-for-unity-fps-starter-project

Assembly Refernce Error

tjones0808 opened this issue · 4 comments

We are accepting issues and we want your feedback.


Description

Describe your issue.
Seems like it can find the correct reference. Am i missing something? I am following the tutorial directly.

Assets\Fps\Resources\Prefabs\UnityClient\HealthPickupClientVisibility.cs(26,65): error CS0234: The type or namespace name 'Update' does not exist in the namespace 'Fps.HealthPickup' (are you missing an assembly reference?)

Assets\Fps\Resources\Prefabs\UnityGameLogic\HealthPickupServerBehaviour.cs(9,17): error CS0103: The name 'WorkerUtils' does not exist in the current context

Expected behaviour

I expect the code to build.

Current behaviour

Possible solution

Steps to reproduce

Environment

The setup health tutorial

Does the assembly definition for your files include a reference to the Improbable.Gdk.Generated asmdef?

You seem to have put the source files in the Resources/Prefabs folder. This might not be included by the default Improbable.Fps asmdef that is included in the project.

It's location is in Assets/Fps

Ok, moved to correct file locations. WorkUtils is okay but still can't find the HealthPickup.Update method.. Thanks for the help!

Ok, moved to correct file locations. WorkUtils is okay but still can't find the HealthPickup.Update method.. Thanks for the help!

That's because there is a namespace collision. HealthPickup is also a namespace under FPS as well as a class under Pickups. Simple fix is to change the signature to private void OnHealthPickupComponentUpdated(Pickups.HealthPickup.Update update) so that you explicitly access the HealthPickup class.

I definitely do think this is an issue with the documentation that should be fixed. The tutorial cannot be completed as-is with copying the code.

Hey @tjones0808 & @shanepadgett, thanks for the report!

We've updated the code samples on the health pickups tutorial to fix both the namespace collision issue and the WorkerUtils issue.