How do I Make A Directional Arrow To Locate Objectives?

Get help using Construct 2

Post » Thu May 18, 2017 4:21 am

So i currently have a sprite drawn to look like an arrow. its on a seperate layer than game, on a HUD layout, 0 scroll 0x0 parallax. HUD works fine. Arrow angle is set to (Global VariableX), (Global VariableY), with events changing the variables to the current objective. I Find that the arrow function works, however since it is on a seperate HUD layer, its position doesn't actually move. How would I go about setting the arrow to point in the direction that the objective is in from the players orientation? I'm assuming that the answer is some sort of equation including player.x - objective.x etc, but i dont know what exactly it is, also, i may be over thinking it, and it may not be an equation at all. not to say there's any one correct way to achieve something. However, i feel like this is a fairly basic thing that i haven't seen covered , and did a quick search, so my apologies if this is answered a million times already. the final piece of code im looking for reads something along the lines of, set arrow angle at object from player position, i just dont know how to get the "from " part.
B
23
S
12
G
1
Posts: 109
Reputation: 2,801

Post » Thu May 18, 2017 4:44 am

Arrow set angle(arrow.X,arrow.Y,targetx,targety)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu May 18, 2017 4:54 am

cuts me off at the comma
B
23
S
12
G
1
Posts: 109
Reputation: 2,801

Post » Thu May 18, 2017 4:59 am

nvm, the angle was where i as messing up, didnt include the function so it wasnt reading corrrectly. thank you. and for anyone else having trouble with this, it ended up being angle(player.x,player.x,target.x,target.y) , but nevertheless the same. thank you much.
B
23
S
12
G
1
Posts: 109
Reputation: 2,801


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests