OnTriggerStay2D Doesn't Work After Scene Reload?
Hi everyone,
I have a prefab with a kinematic rigidbody2D and a polygon collider2D that gets instantiated, of course, by another script. When I first go into play mode, OnTriggerStay2D behaves as it should. When the player dies, SceneManager.LoadScene() is called. After this, the prefabs are still being spawned correctly, however, they detect no collisions. All other game objects work fine.
I have played around with the Sleeping Mode options on the rigidbody to no avail. I don't have any Don'tDestroyOnLoad objects, so I thought everything should be reset properly. Not to mention, these prefabs are instantiated during runtime so the script should always be "fresh"? This also happens if I load a different scene and come back.
I'm at a loss as to why this is happening. Am I missing something small? If this is a bug, can someone suggest a workaround?
Thanks in advance for any solutions, suggestions, or pushes in the right direction!
EDIT: It works now on scene reload, but not after moving to a new scene and back? This must be a bug? Any ideas?
Still having this issue when moving to a new scene and back. If I reload the scene, it works as it should. There are no errors popping up, so I have no idea what I'm supposed to be looking at to fix this issue.
Any solutions, suggestions, opinions? Anyone?
Your answer
Follow this Question
Related Questions
LoadSceneAsync The game freezes. 0 Answers
Trigger enter and directly Exit 0 Answers
Fade out / fade in scene w/ loading screen 0 Answers
Need Help with a Level Reloading Script (c#) 1 Answer
Help with Trigger Colliders.. 0 Answers