- Home /
Screen Space Camera object following a Screen Space Overlay object - (trail renderer) HELPLZ!
Hi, I have two canvases both using 'Canvas Scaler' at 1536x2048. matching width @px ref 100. I want to have a Transform object in the hierarchy follow a RectTransform based object in the ScreenSpace-Overlay canvas. The following object is a trail renderer while adds a little complexity as it only seems to render relative to the ScreenSpace-Camera canvas which I also have in the Hierarchy, rather than show the trail following the Transform object in the Game view, its only visible in the Scene view. How can I convert this position vector to match so the trail follows the object? Many thanks for any help or advice.
Answer by Kusakubari · Apr 10, 2019 at 11:16 AM
So it was actually very simple...
Even though the object to follow was in a "Screen Space Overlay" Canvas, and the trail needed to be in a "Screen Space Camera" Canvas to be visible : they both shared the same anchoredPosition.
Just add the trail renderer in its own "Screen Space Camera" Canvas, then add code ... private void Update() { if (showTrail) trailRectTransform.anchoredPosition = ballRectTransform.anchoredPosition; }
Your answer
![](https://koobas.hobune.stream/wayback/20220612195005im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is there a way to render models over the UI 1 Answer
Screen Space - Camera to Screen Space - Overlay switch issue 0 Answers
Set Image or Sprite to not ReadPixel 0 Answers
problem with canvas 0 Answers
Canvas screenpspace overlay for a particular camera 0 Answers