Search Unity

[Physics2D] Rigidbody.Velocity and Alignement of Sprite Rotation

Discussion in 'Scripting' started by renman3000, Feb 1, 2019.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    I am using a Physics2D, RigidBody2D.
    I am applying an orbiting, gravity like force, so the player can rotate around planets, or is affected by their pull.

    My issue is rotating either the rigdbody itself or a child'd sprite.transform, to point (rotate) in the direction of movement.


    How can I best achieve this?
     
  2. beanie4now

    beanie4now

    Joined:
    Apr 22, 2018
    Posts:
    311
    renman3000 likes this.