- Home /
Question by
JiveViking · Nov 20, 2020 at 09:04 PM ·
positiontransform.positionlinerenderer
LineRenderer position different in editor than player
I have a line renderer set up that is in the correct position in the editor, but in the build(android) it is not in the right position This script creates the line renderer and sets its first position and assigns a reference in a script attached to it
for (int i = 0; i < distance.Length; i++)
{
if(distance[i] <= maxdistance)
{
GameObject newarc = Instantiate(arc, Vector3.zero, transform.rotation);
newarc.GetComponent<LineRenderer>().SetPosition(0, transform.position);
newarc.GetComponent<arcTarget>().target = enemies[i];
then the script attached updates the second position with the reference
gameObject.GetComponent<LineRenderer>().SetPosition(1, target.transform.position);
Comment
Your answer
Follow this Question
Related Questions
Moving an object object x pos + speed?? 0 Answers
How do i make my background keep the same position as my character? 0 Answers
transform.position in fixedUpdate() different from transform.position in Update(); 1 Answer
Firing a shell from a tank which rotates 2 Answers
collider triggers transform position 1 Answer