playMaker

Author Topic: Build Problem with triggers and world space UI  (Read 236 times)

Fitbie

  • Playmaker Newbie
  • *
  • Posts: 24
Build Problem with triggers and world space UI
« on: April 29, 2022, 02:46:32 AM »
Hi guys I have two problems and they are probably related to each other. (game is 2D)

1. On some(!) scenes in the build do not work triggers, and actions namely mouse over, mouse exit, etc. Below is a screenshot: I have an inventory system, when I start dragging an item FSM receives a signal BeginDrag and below are checking, if the mouse is over the collider object when you press the key, the player "gives" the item. The problem is that in the build (only in the build not editor) in some scenes it stops working. And the conditions are exactly the same: I checked and layers, and Z coordinates, and does not overlap another collider, and so on. The only thing that helped was moving the object with the collider farther along the Z axis, but the joke is that it's 50/50 helps (I have a trigger for the whole Cinemachine Confinder scene and I assume it's the trigger's fault, but I'm not sure. Maybe it's worth creating separate layers? BUT! In other scenes it works all the time, along with the Cinemachine Confinder trigger, no randomness, everything is perfect, im gonna crazy. I can admit that I'm an idiot and missed something important, but maybe there are really problems with colliders and I'm wasting my nerves?

https://i.ibb.co/CMQGL7p/Template-Give-Item.png

So far I've solved this problem by reworking the mechanics: now the player enters the trigger it activates FSM and player can drop item anywhere on the screen and it will work. But I think you understand that this is not elegant and bad way :(

2. On only one scene (which also has 1 problem) the EventSystem does not see the screen space canvas (in editor too). Not at all, I checked everything, on 19 scenes everything works fine, on 1 scene it does not. Could get to the comical: I turned off all the objects on the scene at all - and nothing happens (yes i check all raycasters all canvases - nothing block). Is there any way to look at it (I know about ray debug but tell me please where to look for it? did not do that). EventSystem thinks that it does not exist lol. Thank you!
« Last Edit: April 29, 2022, 02:49:59 AM by Fitbie »

Fitbie

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Build Problem with triggers and world space UI
« Reply #1 on: May 04, 2022, 12:17:48 AM »
I found out by experience that the problem is not related to get/set

Fitbie

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Build Problem with triggers and world space UI
« Reply #2 on: May 26, 2022, 06:14:42 AM »
Okay, it helped to specify the "event camera" property in the world space canvas. But a question: why only in 1 scene didn't work UI events? Would now have to specify all scenes event camera? (by the way I use Cinemachine, if it is important. But in the event camera specify default MainCamera)