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

Rotation around Vector3

Discussion in 'Scripting' started by Noxbuds, Jul 8, 2015.

  1. Noxbuds

    Noxbuds

    Joined:
    Mar 17, 2015
    Posts:
    57
    I know how to rotate around a Vector3 using RotateAround.
    But I want it to be different. I want the rotation to be like that in Elite: Dangerous (just skip to 1:18 in the video)


    How would I achieve this?

    Oh, and please, if you're going to give examples, do it in C#
     
    Last edited: Jul 8, 2015
  2. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
  3. Noxbuds

    Noxbuds

    Joined:
    Mar 17, 2015
    Posts:
    57
    Yes :p it makes weird angles - if I move my cursor up and then sideways and down again, it will have a different z rotation than before
     
  4. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Noxbuds likes this.
  5. Noxbuds

    Noxbuds

    Joined:
    Mar 17, 2015
    Posts:
    57
    May I ask how you configure the settings for that script? I am having some trouble doing so

    EDIT: Never mind, I managed to make it right. I'm using speed 20 on both axis
     
    Last edited: Jul 10, 2015
  6. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    From my very quick testing: I liked these settings:

    distance: 6
    xSpeed: 10
    ySpeed: 40
    yMin: -50
    Everything else on default.

    But it really depends on your projects. I mostly found that xSpeed has to be much lower than ySpeed to feel right, for me.
     
  7. Noxbuds

    Noxbuds

    Joined:
    Mar 17, 2015
    Posts:
    57
    OK. Thank you for replying :)
    Ended up using X & Y speed on 20. It works well.
    Thank you for that.