playMaker

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

heavygunner

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Dynamic Indicator above Player
« on: November 21, 2018, 10:56:34 AM »
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: 4451
    • View Profile
    • jinxtergames
Re: Dynamic Indicator above Player
« Reply #1 on: November 21, 2018, 03: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?
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

heavygunner

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: Dynamic Indicator above Player
« Reply #2 on: November 21, 2018, 05: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: 14400
  • Official Playmaker Support
    • View Profile
Re: Dynamic Indicator above Player
« Reply #3 on: November 21, 2018, 11:31:40 PM »
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