Short version: I want to use the FPSController Standard Asset (or any SA for that matter) but want to extend and modify its functionality. Is there a best practice for this scenario in relation to copying/subclassing/encapsulating/etc.?
Longer version…
I’m currently messing around with a basic FPS. Placed in the FPSController Standard Asset. Now I’m trying to add to and modify the FPSController (player) with my own scripts (having a stamina bar), and I was wondering if there’s any best practices around this. Issues I’m having:
- If I try to add my own scripts to be referenced by FPSController (e.g. a PlayerStamina script I wrote), it doesn’t seem to be able to find it, because it’s in its own namespace? Making my own namespace and trying to use that hasn’t worked yet.
- I could copy FirstPersonController.cs to my own scripts, but the whole prefab has a lot of other baggage with it, so that doesn’t seem like the intended way.
- I could wrap the FPSController object with another Object, but not sure what that’ll get me.
- I could try subclassing (in code) the Standard Asset script, and then reference that script in the prefab instead? Would this have issues with namespaces?
To be clear: I’m not looking for help with the specifics (making a stamina bar or state, etc.), just trying to figure out how to best work with and around the Standard Assets, since they’re segmented off from my own assets and don’t seem to have ready access to my own scripts.