Bizarre Ridigbody2D behavior when re-loading scene...

We are using Playmaker on this project, but I am fairly certain after banging my head against this for a while that the issue is with Unity and not how we’re handling things in our Playmaker FSMs.

Basically we have a rigidbody2d object that doesn’t appear to interact with the scene at all when the tutorial level is loaded if another level was loaded prior to it, even if everything is cleared away in the scene and that level is the only one present.

Our project has a rigidbody2d “hand” that follows the mouse on click and is used to swipe / block objects on the screen. This is done (right now) by disabling the object on mouse up, enabling on mouse down, and the using the Rigid Body 2D Move Position add-on from the ecosystem to move it to a Vector 2 pulled from a mouse pick. There is also a particle system that is a child of the object.

This works fine in the normal gameplay. It works fine if you go right into the tutorial from the main menu. BUT when starting gameplay and then exiting back to the menu to the tutorial, the rigidbody2d seems to be inactive, even if explicitly woken in the setup state. This only happens after following those exact patterns. There are no persistent “don’t destroy” objects anywhere in the game. The gameplay works as it should no matter how many times it’s re-entered, which is especially weird because the whole mouse-follower object and its FSM is a prefab used in both scenes.

Setting the position directly via the transform works to move the object on screen, however the rigidbody still will not act on other objects this way (even in the incorrect way it would by moving the transform directly). Setting the rigidbody position directly via Set Property also does not work.

The particle system child of the object also does not appear when the tutorial is re-loaded in this way.

Anyone have any ideas about what might be happening?

Can you set-up a super simple reproduction of this without all the other gameplay? If so then either provide me with a link to that or submit a bug report so I can help you figure out what is going wrong.

This needs to be a simple reproduction case and not a project with lots of Rigidbody2D otherwise it becomes a nightmare to debug.

1 Like