- Home /
IPointerEnterHandler doesn't work when object switches parent
I'm creating a book app.
When I spawn a page, I put it in a staging area (separate camera from main camera and different canvas).
At some point I bring the object to the main area with: mCurPageGameObj.transform.SetParent(mPageContainer.transform, false);
When I try to interact with the page, IPointerEnterHandler does not work, nor any other pointer handler.
As a test, I spawned the object directly onto the main canvas (linked to main camera) and all of the pointer handler events worked great.
Something tells me that when spawning my object in the staging area and then moving it to the main area that somehow the event system did not update correctly or my object still has ties to the old parent camera / canvas or something.
One thing to note is that the staging area's canvas is Screen Space - Camera. The staging camera renders directly to a render texture. The main canvas is also Screen Space - Camera, but the main camera is just a regular camera (does not render to render texture). Not sure if that matters.
Please help.
This ended up being an issue with Text$$anonymous$$eshPro that was later fixed, FYI.
Your answer
Follow this Question
Related Questions
Buttons stopped working after I temporarily changed the font. 1 Answer
Broadcast mouse event on Canvas 0 Answers
How do Pointer events work? 4.6 UI 1 Answer
Eventsystem requires window focus? 0 Answers