Search Unity

Setting the origin point of a new project

Discussion in 'Getting Started' started by VFRHawk, Jan 21, 2017.

  1. VFRHawk

    VFRHawk

    Joined:
    Jan 20, 2017
    Posts:
    3
    OK, I've started a new project, and added a 75 x 1 x 40 base board that will be my playing surface to it. I now want the bottom left corner of that board to be the 0,0,0 position reference for all subsequent gameobjects, but can't for the life of me work out how to achieve something so simple!

    Can anyone point in the right direction please!?

    Many Thanks
    Graham
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Well, the easy and obvious answer is to grab your board in the Scene editor, and drag it until the bottom-left corner is at 0,0,0.

    If that doesn't work for you, maybe you could explain why so we can suggest something else?
     
    Kiwasi, Ryiah and Schneider21 like this.
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    You could also add an empty GameObject as the board's parent, and position the board such that the bottom left corner aligned with the empty parent's origin. When adding new pieces, their position should be determined based on that of the parent, not the board itself.
     
    Kiwasi and Ryiah like this.
  4. VFRHawk

    VFRHawk

    Joined:
    Jan 20, 2017
    Posts:
    3
    Thanks for the answers. I guess what I'm trying to do is use a series of absolute co-ordinates for the end of an object instead of for the middle of the object..

    I hvae a base board of 75 x 1 x 40 as I siad. What I then want to do is add rail edges to that, so at the moment I've got the base board object at position -37.5, 0, 20 so that it's bottom left corner sits @ 0, 0, 0. So the left rail (the rails are all width 2) sits @ position -37.5, 1, 1 and has a scale of 75, 1, 2. That aligns down the left side of the base board. So far, not too difficult.

    The problem comes when I want to add pieces at angles. So I want to have two pieces at the top of the base board that make an upside down V together. Using absolute co-ordinates, I know the start point of each should be 75, 1, 20 to be in the middle of the top rail. I can use pythagoras to calculate how long they need to be to reach the point on the side rail - for the left angled rail that would be 55, 1, 0 if the bottom left corner of the board is 0, 0, 0. If I use the system Unity seems to, I've somehow got to work out exactly where the middle of that rail would be, rather than where the ends are. Again, I can probably do that using maths, but it seems awfully complicated just to place an object at 45 degrees to another object, so I was hoping there was an easier way to do it...

    Not sure I'm explaining this very well.....
     
  5. VFRHawk

    VFRHawk

    Joined:
    Jan 20, 2017
    Posts:
    3
    You know, it's amazing how typing or saying something makes it easier to picture the solution - the middle of each of those angled pieces is easy to work out - it's 10 in from the ends of the top and side rails.. Doh!

    I still thing it'd be easier to visualise the end of each piece, but I was making it waaaay more complicated in my mind then I needed to.

    Thanks for listening!
     
    JoeStrout and Schneider21 like this.
  6. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    This is called the Rubber Duck effect. Explaining the problem to people who don't know all the details forces you to think of it from an outside perspective. I highly recommend having a rubber duck on your desk, and explaining problems to it when you're stuck!

    I've rarely posted threads asking for help, because 90% of the time that I start, the solution reveals itself to me before I can hit the "Post" button.
     
    Kiwasi and Ryiah like this.