Interactable on a non UltimateCharacterLocomotion

Shadowing

Member
So i noticed today I tried to add a building to act as a quest pick up.
Version 1 seem to work for this.
Does a object have to have a UltimateCharacterLocomotion component for the Interact system? Only thing I can think of that is causing this error.


Error: An IInteractableTarget must be specified in the Targets field.
UnityEngine.Debug:LogError (object)
Opsive.UltimateCharacterController.Traits.Interactable:Awake () (at Assets/Opsive/UltimateCharacterController/Scripts/Traits/Interactable.cs:46)



As I spawn the building. I'm doing something like this. All my Quest NPC all work fine.
Code:
Interactable NPCInteractable = NewSpawn.gameObject.AddComponent<Interactable>();
NonAnimatedInteractable NPCInteractableTarget = NewSpawn.gameObject.AddComponent<NonAnimatedInteractable>();
NPCInteractable.Targets = new MonoBehaviour[1]{NPCInteractableTarget};
NPCInteractable.ID = 4;
 
Setting the target at runtime is the problem. I can take a look at changing this so it doesn't have to be set at edit time.
 
Ya I just don't know yet. That is exactly what the error suggest. I discarded that cause all my NPC's work fine.
everything in the game uses the same script to spawn stuff and all at the same exact order.
 
Top