Trigger event script doesn't work
Trigger event script doesn't work
So I have weird problem .. My OnTriggerEnter/OnTriggerExit events doesn't work, my player has Player tag, rigidbody, box collider on him. My area has sphere collider with is trigger checkbox selected. Same as in tutorial but my event doesn't seem to detect player is entering the circle. I did everything like in this tutorial:
What can be the problem? My player is on different scene that area can it be the problem? Even tho player's collider is entering area trigger?
What can be the problem? My player is on different scene that area can it be the problem? Even tho player's collider is entering area trigger?
- Attachments
-
- Zrzut ekranu_20230115_190614.png (170.24 KiB) Viewed 1615 times
-
- Zrzut ekranu_20230115_190419.png (174.55 KiB) Viewed 1615 times
Re: Trigger event script doesn't work
Hi,
It's fine for the player to be in a different scene.
If you're making a 2D game, tick the Quest Machine Welcome Window's USE_PHYSICS2D checkbox.
Select Edit > Project Settings. In Physics (or Physics2D if you're making a 2D game). In the collision matrix, make sure the Default x Default checkbox is ticked.
Two things could be happening:
1. Unity isn't registering a trigger collision, so the TriggerEvent component isn't firing.
2. Or the TriggerEvent component is firing, but it's sending the wrong message or the quest is listening for a different message.
To verify that it's sending a message, temporarily tick the Quest Machine GameObject's Debug Settings > Debug Message System checkbox. Then play. This will log a lot of activity to the Console. When the player enters the ForestArea, watch the Console for a log that indicates it's sending the message.
if it is sending the message, make sure the quest is in a state that's listening for the message.
It's fine for the player to be in a different scene.
If you're making a 2D game, tick the Quest Machine Welcome Window's USE_PHYSICS2D checkbox.
Select Edit > Project Settings. In Physics (or Physics2D if you're making a 2D game). In the collision matrix, make sure the Default x Default checkbox is ticked.
Two things could be happening:
1. Unity isn't registering a trigger collision, so the TriggerEvent component isn't firing.
2. Or the TriggerEvent component is firing, but it's sending the wrong message or the quest is listening for a different message.
To verify that it's sending a message, temporarily tick the Quest Machine GameObject's Debug Settings > Debug Message System checkbox. Then play. This will log a lot of activity to the Console. When the player enters the ForestArea, watch the Console for a log that indicates it's sending the message.
if it is sending the message, make sure the quest is in a state that's listening for the message.
Re: Trigger event script doesn't work
Okay so as long as I can see trigger works, I clicked debug in quest machine and I can see that message is sending every time player enter the trigger, but now the case is that my quest doesn't react on that, It should make quest node active, but it doesnt. ://
- Attachments
-
- Zrzut ekranu_20230115_210257.png (40.54 KiB) Viewed 1611 times
-
- Zrzut ekranu_20230115_210429.png (104.54 KiB) Viewed 1611 times
Re: Trigger event script doesn't work
In playmode before I enter the area, that quest node named ExploreForest is active, but entering doesn't make that true/success what I want.
Re: Trigger event script doesn't work
Are there any hidden characters such as blank spaces in either the quest's Message Quest Condition or in the TriggerEvent's SendToMessageSystem field?
Re: Trigger event script doesn't work
No there aren't :/
Re: Trigger event script doesn't work
This is how it looks like before entering the area, of course correct database is set up in quest machine and in that database there is my quest.
- Attachments
-
- Zrzut ekranu_20230116_135931.png (34.16 KiB) Viewed 1574 times
Re: Trigger event script doesn't work
Hi,
Does the completed tutorial scene included in QuestMachineTutorialAssets.unitypackage work correctly? (You can download it from the Quest Machine Extras page.)
If the completed tutorial scene doesn't work, please try it in a new, empty project in which you've only imported Quest Machine and the tutorial assets. This will tell us if it's something specific in your original project.
Does the completed tutorial scene included in QuestMachineTutorialAssets.unitypackage work correctly? (You can download it from the Quest Machine Extras page.)
If the completed tutorial scene doesn't work, please try it in a new, empty project in which you've only imported Quest Machine and the tutorial assets. This will tell us if it's something specific in your original project.
Re: Trigger event script doesn't work
I mean, I don't really know what did I do, but it works, I deleted conditions and add them again
Re: Trigger event script doesn't work
Great! I'm glad it's working. Maybe there was a typo somewhere.