Trigger area not work ... what am I doing wrong?

0

this is how I connect to the bus on the OnActivate in the Lua script:

self.triggerHandler = TriggerAreaEntityNotificationBus.Connect(self, self.entityId)

this is my method to handle the event:

    function triggerDoor:OnEntityEnteredTriggerArea(entityId)
Debug.Log("------- TRIGGERED.")
end

The trigger component is configured using default settings, with capsule or boxshape.

But the event does not trigger...

What else should I configure?

Thanks a lot!

질문됨 7년 전219회 조회
6개 답변
0
수락된 답변

Hey @REDACTEDUSER Cheers!

답변함 7년 전
0

@REDACTEDUSER

I have changed, but still not triggering the OnTriggerAreaEntered

This is the Lua Script.

	function triggerDoor:OnActivate()
self.triggerHandler = TriggerAreaEntityNotificationBus.Connect(self, self.entityId)
Debug.Log("OnActivate ")
end
function triggerDoor:OnTriggerAreaEntered(entityId)
Debug.Log("------- TRIGGERED.")
end
function triggerDoor:OnEntityExitedTriggerArea(entityId)
Debug.Log("------- TRIGGERED.")
end
<br>

REMOVEDUPLOAD

답변함 7년 전
0

I read this in the documentation, but I could not find the checkbox.

"Note

You must use a physics component and select the Proximity Triggerable check box in order for an entity to interact with the trigger areas."

Also

At the class TriggerAreaComponent.cpp we have these two lines:

<em>EBUS_EVENT_ID(GetEntityId(), TriggerAreaNotificationBus, OnTriggerAreaEntered, entityId);
EBUS_EVENT_ID(entityId, TriggerAreaEntityNotificationBus, OnEntityEnteredTriggerArea, GetEntityId());
<br></em>
답변함 7년 전
0

@REDACTEDUSER

To help others:

	function puzzeCamera:OnActivate()
self.triggerHandler = TriggerAreaNotificationBus.Connect(self, self.entityId)
end
function puzzeCamera:OnDeactivate()
self.triggerHandler:Disconnect()
end
function puzzeCamera:OnTriggerAreaEntered(entityId)
Debug.Log("------- TRIGGERED.")
end
function puzzeCamera:OnTriggerAreaExited(entityId)
Debug.Log("------- saiu TRIGGERED.")
end

답변함 7년 전
0

Awesome—thanks for solving and sharing!

답변함 7년 전
0

Hey @arineto, thanks for testing that out — I did notice one more thing. Let's give it a try! Please replace TriggerAreaEntityNotificationBus.Connect(self, self.entityId) with TriggerAreaNotificationBus.Connect(self, self.entityId). You may need to re-browse the Lua file in the Lua Script Component for the script to work :)

답변함 7년 전

이 게시물은 마감됨: 새 답변, 댓글 및 투표 추가가 비활성화되었습니다.

관련 콘텐츠