- Home /
Question by
Studio42Apps · May 26, 2017 at 01:50 PM ·
cameravectrosity
Issue with Screen Space - Camera and Vectrosity
I have an orthographic camera that follows a ball around a 2D world space. I'm attempting to draw lines on/around the ball using Vectrosity. The lines render perfectly when the game begins but as soon as the ball has moved one-screen's-width or height away from the starting position, on the x or y axis, the lines disappear.
I can still see the lines being rendered in the correct position on top of the ball in the "Scene" view but they don't appear in the "Game" view.
The main camera has a follow script which is centred on the ball and I have set the VectorCanvas to use the main camera.
A simplified version of my code:
VectorLine.SetCanvasCamera (Camera.main);
Vector2 lineStart = ball.transform.position;
var points = new List<Vector2> (numberOfPoints);
for (int i = 0; i < numberOfPoints; i++) {
points.Add (lineStart + dy);
}
line = new VectorLine("line", points, 6.0f);
line.Draw ();
Any help is appreciated, thank you.
Comment