An arrow that shows where an out-of-frame object is relative to the player?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • The player is a top-down plane that can fly in 360 degrees. Right now he's dogfighting an enemy plane, and I want to have an arrow that continues pointing at the enemy plane even when the enemy is out of the camera's view. Ideally the arrow would hover around the edge of the visible area, but I could settle for sticking it on the player's HUD if necessary.

    It'd be kinda like this (Please login to see this link.), only you could see the arrow all the time and it'd only go invisible whenever the enemy is within the visible area. Any ideas on how to do this?

  • by keeping it simple,
    you could do something like this:


    (prerequisite: on each enemy you spawn, you also create an "arrow" object,
    and give its "instance" alterable value the fixed value of just created enemy)


    always (or whenever you need it to be performed)
    >>> start loop on each one of "enemy"


    on each one of "enemy"
    +enemy X position > x right frame
    +alt.val."instance"(arrow)=fixed value of "enemy"
    >> make arrow reappear
    >> set "arrow" Y position to Y enemy
    >> set arrow angle to OAngle("arrow",x enemy, y enemy)


    on each one of "enemy"
    +enemy X position < x left frame
    +alt.val."instance"(arrow)=fixed value of "enemy"
    >> make arrow reappear
    >> set "arrow" Y position to Y enemy
    >> set arrow angle to OAngle("arrow",x enemy, y enemy)


    on each one of "enemy"
    +enemy Y position > y bottom frame
    +alt.val."instance"(arrow)=fixed value of "enemy"
    >> make arrow reappear
    >> set "arrow" X position to X enemy
    >> set arrow angle to OAngle("arrow",x enemy, y enemy)


    on each one of "enemy"
    +enemy Y position < y top frame
    +alt.val."instance"(arrow)=fixed value of "enemy"
    >> make arrow reappear
    >> set "arrow" X position to X enemy
    >> set arrow angle to OAngle("arrow",x enemy, y enemy)


    on each one of "enemy"
    +enemy X position < x right frame
    +enemy X position > x left frame
    +enemy Y position < y bottom frame
    +enemy Y position > y top frame
    +alt.val."instance"(arrow)=fixed value of "enemy"
    >> make arrow invisible

    a selection of my Fusion examples can be found Please login to see this link.

  • I think this should work:

    - Allways
    -> Arrow setX to:
    Max( XleftVissibleFrame, Min( XrightVisibleFrame, EnemyX ) )
    -> Arrow setY to:
    Max( YtopVissibleFrame, Min( YbottomVissibleFrame, EnemyY ) )

    How can i change username and display name?
    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!