playMaker

Author Topic: Trigger2dEvent doesn't work with time scale stop  (Read 1392 times)

FoxShady

  • Playmaker Newbie
  • *
  • Posts: 5
Trigger2dEvent doesn't work with time scale stop
« on: June 18, 2023, 09:37:02 PM »
Hello,

So essentially I am implementing a pause feature into my project. You hit space bar and it turns the time scale to 0. Hit it again it returns it to 1. In my project, you can drag an object over a panel and it will fire off an event using the Trigger2d.

The problem is when I pause it won't register that the object has been dropped onto the panel. The Trigger2d event doesn't fire off. When I unpause it works again. I followed the drag and drop ui tutorial on the official youtube channel and am using that setup. It stops at the "not over" state.

I would love to know what's going on or if there is a better way to implement what I am doing. If you need further information feel free to ask. Any help is appreciated!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Trigger2dEvent doesn't work with time scale stop
« Reply #1 on: June 19, 2023, 01:12:46 PM »
Hi.
on the Trigger2d event are you using trigger enter or trigger stay?

FoxShady

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Trigger2dEvent doesn't work with time scale stop
« Reply #2 on: June 19, 2023, 07:16:05 PM »
It uses OntriggerStay2d

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Trigger2dEvent doesn't work with time scale stop
« Reply #3 on: June 19, 2023, 10:58:36 PM »
I believe that FixedUpdate is not called if you set time-scale to zero
and i believe that trigger events are in fixed update.

so probably 2 option find a way without pause.

or try different detections, for example box cast or overlap (position also an option)

FoxShady

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Trigger2dEvent doesn't work with time scale stop
« Reply #4 on: June 20, 2023, 08:06:45 AM »
Hello,

First off thanks for the info and the assistance. Looked it up and yeah FixedUpdate is not called. Now I know.

I ended up just "mimicking" the pause feature by calling a global event that stops actions from continuing once the space bar is pressed. It doesn't even touch the time scaling action.