playMaker

Author Topic: How ot set a sprite angle relative to 2 other sprites ?  (Read 947 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
How ot set a sprite angle relative to 2 other sprites ?
« on: February 21, 2019, 01:54:28 PM »
Well, everything is in the title, i have some difficulties to find the right formule to get the desired result...

i tested the action get angle from 2 transform objects, but it doesn't works like espected with UI.
for now the angle is always = to 90

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How ot set a sprite angle relative to 2 other sprites ?
« Reply #1 on: February 22, 2019, 12:44:43 AM »
Hi.
maybe this can get you in the right direction :

https://answers.unity.com/questions/1038431/make-ui-compass-point-to-3d-object.html

in ecosystem you can search for actions by searching for parts of code.
Like for example "Mathf.Rad2Deg" or "Mathf.Atan2"

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: How ot set a sprite angle relative to 2 other sprites ?
« Reply #2 on: February 22, 2019, 02:04:45 AM »
thanks, got something near to solve my problem with this