Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Changing an Object's Rotation point?

Discussion in 'Editor & General Support' started by James-Sullivan, Jun 25, 2015.

  1. James-Sullivan

    James-Sullivan

    Joined:
    Jun 15, 2015
    Posts:
    128
    Hello. As a practice exercise, I'm remaking pong in Unity. I've been trying for the last couple of days to make the target swivel pointer. It shows were the ball/puck is going to launch and moves up and down. Its a rectangle where one end stays centered at (0,0) and the other end moves to point at the launch direction. I've tried using RotateAround and changing the pivot point of the sprite but neither seemed to work. Changing the pivot point didn't change where the image rotated, just where the image was drawn. I'm now trying to do it via script and some trigonometry using the object's rotation. Is there some easy way to do this that I'm not seeing?
     
  2. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Make an empty parent and rotate that. It will rotate around the parents pivot.
     
  3. James-Sullivan

    James-Sullivan

    Joined:
    Jun 15, 2015
    Posts:
    128
    Victory! Thanks so much!
     
  4. mhvelplund

    mhvelplund

    Joined:
    Dec 28, 2016
    Posts:
    1
  5. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276