Sry am resurrecting this thread here.
I am a newbie building a 2D game for mobile and I have been following this thread, I’ve been able to manage most things myself until now but this is beating me.
I have two cameras setup as per the attached screen shots.
I have been trying to implement a similar effect in my case an object collision, which creates a scoretext in the UI layer, that then travels to my UI score counter in the top RHS of my screen. Effectively option 2 from above although I trigger based off a scoring collision.
I had been attempting to do this by grabbing the position of the gameplay object at the point of impact, converting the transform position to a screen point via the Gameplay (MainCamera) e.g.
Vector3 pos = GameManager.GMInstance.GetMainCamera().WorldToScreenPoint(gameObject.transform.position);
Then I was getting a pooled UI text object, enabling it and setting the text value, color and most importantly position based on pos, the pooled items are parented to my Canvas transform. Eventually I wanted to DoTween it to the score counter, but I have not been able to get that far.
I think a big part of the issue is that the initial pool creates objects which are scaled very high e.g. 38.876% with exaggerated coordinates e.g. Vector3(-388.999939,-1320.547,-3683.23853). I think this might be the point where the UI Camera lives, I am not sure if this is because I have the pooling script attached to a UI panel in the canvas?
I could be going about this all wrong I’m not sure, but I’ve tried a few things and not had much luck. I’m not sure if that is the best way to pool UI elements i.e. attached to the canvas, but as I could have up to 100 items repeatedly colliding on screen I do not want to create and destroy UI elements.
Any advice or ideas as to why I am not cracking this would be much appreciated.