TimeScale with zero - no collisions or triggers?

Hey, I am having a problem and I’m not sure if it’s a Unity problem or some NGUI drawback…basically I am trying to do an in-game pause menu, but when I set the Time Scale to zero, I can’t get any colliders or triggers on the buttons to happen. At all. How does anyone do this?

I read that RayCasts didn’t work with timescale zero awhile ago, but that it has been fixed. Has it? Does that have anything to do with this?

Perhaps mouse input.

Can you expand on that a bit? I’m all out of ideas and really can’t believe that something as basic and needed-by-everyone can’t be so weirdly difficult.

When Time.timeScale is set to zero Update, FixedUpdate, LateUpdate and any other update function won’t be called, so this is probably the source of your problem - your entire Update function is not being executed so any code inside will be ignored.

try putting that code in a co-routine instead.

I can give you 2 helpful links for this:

http://gamingirresponsibly.com/tag/unity-invokerepeating

Thank you for trying to help…I know for a fact that the post you are referring to is partially incorrect. The “Update” function continues to be called normally, so I don’t need coroutines. It is correct that FixedUpdate is not called any longer, and that may be the entire source of collisions not working. So how to solve it?

If no updates work, perhaps attaching a script to an object, texture for instance more specifically a plane with a texture on it, with a mouse event.

OnMouseUp()… Unpause.

maybe you could just stick everything in the update function?

oops. I misread. Well you can still you what I suggest as it negates any raycast. The mouse event could, I guess be judged inside the update or be its own function.

Well you can…but then how do you tell that you have clicked the area that 1 of 4 buttons is in, and which button you clicked? Do we really need to map out coordinates and attempt to do a raycast to do in-game pause menus? That is, if raycasts even work with zero timescale…Come on, no one has done an in game pause menu?

I am sorry, I haven’t got there yet with my game. I can give you a script that works with update(and therefore timescale) and instructions.

make a guiTexture your button and attach this script to it.

Button.js:

var rectangle : Rect = Rect (0, 0, 40, 40); //put the numbers for the area and size of your button in this Rect

if (rectangle.Contains(Input.mousePosition) Input.GetMouseButtonDown(0)) {

//stick your code in here

}

I hope this helps, sorry if for the inconvenience.

Update NGUI. That has been fixed a long time ago.