Problem with Interact ability and multiple triggers

Vlaxep

Active member
Hi,

Just having some issues with two separate Interactables....

Both have Interactable ID = -1

the Interact ability uses interactable id of -1

Problem is which ever I use first, the ability won't stop detecting the first trigger interactable i walked in to.

Moving out of it doesn't stop the interact ability trying to use it, and therefore I can't interact with the second one.

I'm sure it's a simple fix, just wondering whether each interactable is supposed to have a different interactable ID, or I shoul dbe using Object identifier or what?

Cheers
 
You can start to debug this by placing a breakpoint within DetectObjectAbilityBase.OnTriggerExit - when you exit the trigger it should be called and prevent the ability from being able to be started again.
 
Ok thanks @Justin, it revealed that using only one Interactable causes the issue.

It was my custom code causing the issue. So upon interacting I'm trying to disable the interactability for a couple of seconds...

I tried using Interactable.Enabled = false > Wait for time > Interactable.Enabled = true

However this doesn't stop the player being able to interact for some reason. Perhaps you can suggest how or why?

Because this wasn't working I was then disabling/re-enabling the trigger collider, hence why no OnExitTrigger was being detected if exiting the trigger quickly after interacting, so that makes perfect sense.

But perhaps you can suggest the best method to disable the interactability?

Cheers,
Vlaxep
 
For now have a solution of just increasing the Interact ability complete time to 2 seconds.

Not sure why Interactable.Enabled = false doesn't stop player being able it interact with it though....
 
Hmm ok I think the best solution for me is to use InteractableID, and temporarily switching it to a value the player cannot interact with,

that way I'm not locked in to the timeframe for the ability which limits movement of the player!
 
Top