playMaker

Author Topic: Dynamic Indicator above Player  (Read 1197 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Dynamic Indicator above Player
« on: November 21, 2018, 12:56:34 PM »
Hi !

I wanna put a small Red Indicator above Player like this screenshot.
It should find object with tag "Money", then should get it direction and turn towards it every frame dynamically. This indicator will be child of Player & will travel along with player.

If is finding Object and Getting the Location. But, when I activate Smooth Look at direction, It's going out of view too far. How Can i get it done?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Dynamic Indicator above Player
« Reply #1 on: November 21, 2018, 05:06:31 PM »
Hi.
I am not exactly sure what you mean, maybe you can show the issue in a video?

Maybe you can try Vector3 Rotate Towards?

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Dynamic Indicator above Player
« Reply #2 on: November 21, 2018, 07:10:41 PM »
Hi.
I am not exactly sure what you mean, maybe you can show the issue in a video?

Maybe you can try Vector3 Rotate Towards?
Hi !
I passed that issue for now and working others. Take a look at this picture. It's showing off screen target indicators. I also wanna show a indicator above player.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Dynamic Indicator above Player
« Reply #3 on: November 22, 2018, 01:31:40 AM »
Hi,

for this,I would so this.

get the screen position of the ennemy, it will be off screen, then find the intersection between the line [Screen center - Ennemy] and the border of the screen. you will likely need to get the angle of the line to know which side of the screen it should be shown.

your drawing makes perfect sense, and you should base your logic on this. you will need to learn about line intersections algorythm though: https://stackoverflow.com/questions/4543506/algorithm-for-intersection-of-2-lines


Bye,

 Jean