Unity2D game draw arrow based on relative position to object.
Hello,
I firstly hope this is in the correct section since this is my first time posting here...
I am trying to get an arrow to draw the relative position between the player and an object. I have a single arrow image and rotate it when nessecary to show the position of an object on an image (to be changed later into the HUD). I have only recently started working in unity and i cant seem to get it to work. The function I used to rotate my arrow is bugging really bad and the result is horrible.
I am probably doing some things that are bad practice since I just started, but if anyone has an idea on how I need to approach this, it would be very much appreciated.
Code: http://pastebin.com/E7puFTjL
PS: this might be on here already but since I couldnt find it I decided to make a topic about it. if im wrong please redirect me to the page where I might find the answer.
Your answer
![](https://koobas.hobune.stream/wayback/20220612051523im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Have object reach a location relative to another object's rotation 0 Answers
How to make a Child object(camera) ignore its Parent Object's rotaton? 1 Answer
Detecting Uniducial marker only on specific Rotation. 0 Answers
Does a game object referenced in-script, automatically become a "local" origin point? 0 Answers
Affecting an object's position through another object's rotation 0 Answers