Multiple Abilities Mapping to the Same Input

airoll

Member
Hi, I am currently working on a VR game and have some questions about mapping multiple abilities to the same input. Right now my game is setup in the following way. In my primary game mode, the following abilities are set:

Use (Slot 0) (ItemAbility) -> Mapped to Right Hand Trigger Button
Teleport (Ability) -> Mapped to Left Hand Trigger Button

In the secondary game mode, I would like the character to be able to dual wield weapons so that the following abilities are set:

Use (Slot 0) (ItemAbility) -> Mapped to Right Hand Trigger Button
Use (Slot 1) (ItemAbility) -> Mapped to Left Hand Trigger Button

I am wondering what's the best way to implement this:
  1. Should I create the additional Use (Slot 1) ability in my character prefab and disable it for the primary game mode but enable it for the secondary game mode? If I do this, will there be any conflicts (since multiple abilities map to the left hand trigger button)?
  2. Or, since I load a character scene in the secondary game mode, I can modify the instance of the prefab, and add these new abilities. My only concern would be - if I then modified the prefab later (by adding new abilities), how would that affect the serialization of the modified prefab?
Thanks so much for your help and guidance!
 
Should I create the additional Use (Slot 1) ability in my character prefab and disable it for the primary game mode but enable it for the secondary game mode? If I do this, will there be any conflicts (since multiple abilities map to the left hand trigger button)?
You can have the same input without an issue. If you only want one to be triggered at a time though it does make sense to enable/disable it.

Or, since I load a character scene in the secondary game mode, I can modify the instance of the prefab, and add these new abilities. My only concern would be - if I then modified the prefab later (by adding new abilities), how would that affect the serialization of the modified prefab?
In version 3 the abilities are serialized by Unity so it follows the same set of rules as any prefab. In version 2 there is a custom serialization which limits the usefulness of prefabs so I recommend upgrading to version 3 if you haven't already.
 
Top