Keplerians
New member
Hi!
I am having an issue with a own system of floating buttons when the player is near interactable objects.
I am triggering by my side the interactable objects, and i figured out that the detectObjectAbilityBase has some issues with triggered objects.
My code example to test, the result while playing. This component is attached to my character, and as you can see, the trigger amount and the triggers are not equal.
For accessing the detected objects array and the trigger amount, i have the next code:
So, it seems that in some way, the detected trigger objects array is not being updated properly...
Any idea about this?
Thanks,
I am having an issue with a own system of floating buttons when the player is near interactable objects.
I am triggering by my side the interactable objects, and i figured out that the detectObjectAbilityBase has some issues with triggered objects.
My code example to test, the result while playing. This component is attached to my character, and as you can see, the trigger amount and the triggers are not equal.
C#:
public class TriggerDetectionTest : MonoBehaviour
{
public List<GameObject> triggers;
public int triggerAmount;
CustomInteract customInteractAbility;
void Start()
{
customInteractAbility = GetComponent<UltimateCharacterLocomotion>().GetAbility<CustomInteract>();
}
void Update()
{
if (customInteractAbility != null)
{
triggers = customInteractAbility.detectedObjects.ToList();
triggerAmount = customInteractAbility.triggerAmount;
}
}
}
For accessing the detected objects array and the trigger amount, i have the next code:
C#:
public GameObject[] detectedObjects => m_DetectedTriggerObjects;
public int triggerAmount => m_DetectedTriggerObjectsCount;
So, it seems that in some way, the detected trigger objects array is not being updated properly...
Any idea about this?
Thanks,