Search Unity

Question How to customize size and position of 2D circle

Discussion in 'Editor & General Support' started by Unity-Student0, Jan 1, 2023.

  1. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Hello,

    My title is very clear:
    1 - Can i change the code so that I can change this into a semi-circle? I actually want a semicircle, not a complete one.
    2 - I am currently learning how to draw lines. Please note that my semi-circle is actually part of another object - It's actually a test tube. So i need to join the semicircle to the line and make it look like an object.
    3 - Multiple test tubes. I will check this later once I learn how to to (1).

    Can someone help? I succeeded creating a complete circle by using
    . I tested it on my phone and it works correctly. If anyone wants to recommend blender, please make sure the learning curve is easy. If I spend a few months on blender, I might have forgotten certain things in Unity.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    After computing the point for each chunk of the circle, add the offset of where you want the center of the circle to be, then use that value instead.

    EDIT: for the above video, just set the LineRenderer to use Local coordinates and then move the Transform of the GameObject that you put it on.
     
  3. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Can you please share some code? I'm not an expert yet. I'm currently on another tutorial where I have gained some very basic understanding so I can create an incomplete elementary game after practicing many times. In the meantime, my other tutorial is giving me a better understanding by going step by step. You should do the same. Either that or just don't bother replying my post as I can't follow.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    You have made 239 posts here and you are not able to change the position of a GameObject?

    Post the code you have and ALSO: tell the forum "This is the line where the GameObject with the circle on it is stored."

    Otherwise I must conclude you are not actually making any serious legitimate effort.

    The purpose of this forum is to assist people who are ready to learn by doing, and who are unafraid to get their hands dirty learning how to code, particularly in the context of Unity3D.

    This assumes you have at least written and studied some code and have run into some kind of issue.

    If you haven't even started yet, go check out some Youtube videos for whatever game design you have in mind. There are already many examples of the individual parts and concepts involved, as there is nothing truly new under the sun.

    If you just want someone to do it for you, you need go to one of these places:

    https://forum.unity.com/forums/commercial-job-offering.49/

    https://forum.unity.com/forums/non-commercial-collaboration.17/

    https://livehelp.unity.com/?keywords=&page=1&searchTypes=lessons